By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,007 Members | 1,023 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,007 IT Pros & Developers. It's quick & easy.

Python is fun (useless social thread) ;-)

P: n/a
I have to say, I'm having a very enjoyable time learning and using
Python. I spent a year playing around with C# and I feel like I
learned/know less about it than I do about Python from just the past
couple of months. Of course it's easier, but there's just something
about it that makes me keep coming back to it and try to think of new
ways to use it.

Lately I've started to branch away from the "core" Python and I started
learning internet/cgi programming, then a little with mysqldb (which
involved a detour into learning some MySQL query commands), and now I'm
fiddling with wxPython. My next goal is PyGame.

So out of curiosity, I'm just wondering how everyone else came to learn
it. If you feel like responding, I'll ask my questions for easy quoting:

Did you have to learn it for a job?

Or did you just like what you saw and decided to learn it for fun?

Also, how did you go about learning it? (i.e., like I described above, I
started with the main stuff then moved on to the different available
frameworks)

Was there any necessity in the specifics you learned, or did you just
dabble in something (e.g. wxPython) for fun?

Are there still some things you feel you need to learn or improve?

Additional comments/complains here: :)
Jun 15 '06 #1
Share this Question
Share on Google+
47 Replies


P: n/a
On 2006-06-15, John Salerno <jo******@NOSPAMgmail.com> wrote:
So out of curiosity, I'm just wondering how everyone else came
to learn it. If you feel like responding, I'll ask my
questions for easy quoting:


I didn't want to use Outlook to read my e-mail, so I needed a
way to get them onto a non-MS box. The only way to suck my
e-mails out of the MS server was to use the COM API built into
Outlook.

I didn't have any development tools on the Windows machine and
wasn't about to pay MS for a C/C++ compiler.

Google found me an example of doing COM stuff using Python.

It turns out that using Python was way easier than using C
would have been.

--
Grant Edwards grante Yow! This is a NO-FRILLS
at flight -- hold th' CANADIAN
visi.com BACON!!
Jun 15 '06 #2

P: n/a
John Salerno wrote:
So out of curiosity, I'm just wondering how everyone else came to learn
it.


I have already reported my first experiences with Python here:
http://groups.google.com/group/comp....77eba36a97751d

Michele Simionato

Jun 15 '06 #3

P: n/a
> Did you have to learn it for a job?

No, I learned it because Perl was too dirty and Java to complicated.
Now it is part of my daily job.
Also, how did you go about learning it?
Programming, reading this newsgroup, reading the python cookbook,
reading python source files of the standard library.
Was there any necessity in the specifics you learned, or did you just
dabble in something (e.g. wxPython) for fun?
I tried wxPython, but switched to pygtk. And I did some cgi programming
with quixote and ZODB.
Are there still some things you feel you need to learn or improve?


There are some things in Python I don't know very well: Decorators and
generators. But somehow I don't think that I really need them.

Thomas

--
Thomas Güttler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de
Spam Catcher: ni**************@thomas-guettler.de

Jun 15 '06 #4

P: n/a

Thomas Guettler wrote:
There are some things in Python I don't know very well: Decorators and
generators. But somehow I don't think that I really need them.


I think that I learn best when I have a problem and I'm trying to solve
it.
There are features that you don't know what they're for, and you never
use it, but when you come across an scenario where none of the features
you know can help you, you start wondering "there must be something
else..." and a quick search in google, or a python recipe, will give
you the solution and a sample usage of these features.

Jun 15 '06 #5

P: n/a
In article <jA******************@news.tufts.edu>,
John Salerno <jo******@NOSPAMgmail.com> wrote:

I had retired from Apple in 2001 after 33 years in the business, feeling
completely burned out. Didn't want to even look at another line of code.
After resting and recuperating for a couple years, though, I picked up a
book on Python (Alex Martelli's wonderful "Python in a Nutshell") and
started tinkering with it. I was utterly amazed at how well Python's
metaphors fit my way of thinking. It was actually fun to program again!

So now I'm back at work full-time, at a company that lets me do 95%+ of
my work in Python, and I'm having the time of my life. My copy of the
Martelli book is seriously dog-eared at this point; I'm glad a new
edition is being released in a few months.

In short: Python rocks.

Dave Opstad
Jun 15 '06 #6

P: n/a
Thomas Guettler wrote:
There are some things in Python I don't know very well: Decorators and
generators.


Then you should come at EuroPython and attend at my talk! ;)
But if you can't come to Switzerland, you can always look at

http://www.phyast.pitt.edu/~micheles.../decorator.zip
http://www.phyast.pitt.edu/~micheles...mentation.html

Michele Simionato

Jun 15 '06 #7

P: n/a
>> Did you have to learn it for a job?

No.
Or did you just like what you saw and decided to learn it for fun?
Tried Perl first, but since I don't use it every day (sometimes don't
do anything but RUN scripts for weeks on end if I'm in a big project),
I would forget all of the Perl between learning sessions. Python seems
to be made of words, not symbols. Also, it seems to be a minimalist
language. I like that.
Also, how did you go about learning it?
I had no computer science background, just a long time Windows user.
The Guido tutorial moved way too fast. Alan Gauld's "Learning To
Program" was just right. From there, lurking on this group, and books.
Especially the Python Cookbook, as I don't normally 'get it' when
someone just describes theory or an abstraction, I also must see an
example. The examples in the Cookbook are useful and also come with
explanations about how they work. Same goes for this group. Nine times
out of ten, when people answer a question here, they toss off an
example or two, which is just what I need.
Was there any necessity in the specifics you learned, or did you just
dabble in something (e.g. wxPython) for fun?
I almost always have a task I want to do, e.g. search a database or
manipulate files. From there, I branch out and learn, even if it's not
part of the original task.
Are there still some things you feel you need to learn or improve?


I am not touching OO, classes, or GUIs until I understand EVERYTHING
else. Could take a few years. ;)

rd

Jun 15 '06 #8

P: n/a
John Salerno napisa³(a):
So out of curiosity, I'm just wondering how everyone else came to learn
it. If you feel like responding, I'll ask my questions for easy quoting:

Did you have to learn it for a job?

Or did you just like what you saw and decided to learn it for fun?

Also, how did you go about learning it? (i.e., like I described above, I
started with the main stuff then moved on to the different available
frameworks)

Was there any necessity in the specifics you learned, or did you just
dabble in something (e.g. wxPython) for fun?

Are there still some things you feel you need to learn or improve?


The very first encounter was with Red Hat 5.2, back in 1998. RH had an
installer made with Python and NEWT toolkit. It looked great, just about
as good as any of my Clipper or TurboVision programs. I looked at the
code and it scared me (at this time, I was writing mostly in Clipper).

Then in 2001 I came to work in another company, which has MS Proxy at
its internet border. Being unable to use any of internet tool of my
choice, I quickly found a solution, NTLM Authorization Proxy Server
(NTLMAPS) by Dimitri Rozmanov. Which, to my surprise, is written in pure
Python. This time I was ready to learn Python. I started using it for my
spare-time projects and later I was able to "inject" Python to my
organization. This can be concluded as "learned for fun", but now it
takes part of my paid work.

I started with writing "glue" code for various system tools (i.o.w. as a
"shell scripting"), but now I tend to write standalone client tools,
with GUI in various toolkits (wxPython at work, PyGTK in my spare time).
They are mostly of "smart client" type, using various network interfaces
(ftp, http, xmpp, MQSeries).

And I still don't get this "web application" hype, and all these "web
frameworks" scare me, as I internally don't trust any magic.

--
Jarek Zgoda
http://jpa.berlios.de/
Jun 15 '06 #9

P: n/a
Sybren Stuvel wrote:
Are there still some things you feel you need to learn or improve?


I'd love to be able to calll functions from Windows DLLs on x86 Linux.


call functions *in* DLLs, you mean?

http://docs.python.org/dev/lib/module-ctypes.html
http://starship.python.net/crew/theller/ctypes/

</F>

Jun 15 '06 #10

P: n/a
Michele Simionato wrote:
John Salerno wrote:
So out of curiosity, I'm just wondering how everyone else came to learn
it.


I have already reported my first experiences with Python here:
http://groups.google.com/group/comp....77eba36a97751d

Michele Simionato


Very interesting post. And I definitely agree with you that, as much as
everyone seems to suggest the tutorial, I find it very difficult to
actually learn from. It helps to provide a review for the language, but
as a newbie, I really wouldn't have learned Python from it.

I do, however, think the docs are pretty good, although I sometimes find
myself just wishing that a function definition was simply laid out in an
easy to read format that included all of its parameters, so I would know
exactly what to pass to it (I guess help() is good for this though).
Jun 15 '06 #11

P: n/a
BartlebyScrivener wrote:
.... I am not touching OO, classes, or GUIs until I understand
EVERYTHING else. Could take a few years. ;)


You know how modules separate globals, right? That is, what you
write in one module doesn't affect the names in another module.
What classes (and hence OO) give you is a way of saying, "I'd
like something a bit like a module, but I'd like to make several
of them, and not have them interfere with each other." That is
the big intuition about objects, the rest is just details.

--Scott David Daniels
sc***********@acm.org
Jun 15 '06 #12

P: n/a
BartlebyScrivener wrote:
I am not touching OO, classes, or GUIs until I understand EVERYTHING
else. Could take a few years. ;)


LOL. That's exactly why I love Python, because you don't have to mess
with any of that (explicitly) if you don't want to! Of course, here I am
probably going way overboard by messing with classes and GUIs. I'd like
to reinforce all the Python basics first though, so I don't want to get
too far ahead of myself. I just need to find a project to work on that
will limit me to the Python basics (although I'm sure that will still
involve classes, at least).
Jun 15 '06 #13

P: n/a
Jarek Zgoda wrote:
And I still don't get this "web application" hype, and all these "web
frameworks" scare me, as I internally don't trust any magic.


Yeah, I dabbled with CGI, but I haven't seriously looked into anything
like TurboGears yet. Of course, my problem is that I don't *need* to
learn TurboGears, Django, etc...I just feel the desire to learn them
(which is bad, in a way, because then I have no reason to use them!) And
of course learning a framework like this means learning a lot of other
parts too, like CherryPy, Mochi or something like that, etc. :)
Jun 15 '06 #14

P: n/a
John Salerno wrote:
When I was pursuing a PhD, I was working on query optimization in
object-oriented databases. My thesis was that you could actually
do query optimization without breaking encapsulation, and I had
several tricks that I knew how to use to do that. I needed a
language in the DB that had static typing but no implication of
shared structure (implementation or class). In my investigation
for the work, I kept seeing references to Python, but (A) the white-
space issue made me think it was silly, and (B) I needed a static
typing for my work.

After graduate school, I returned to one of my hobby projects, a
string search program, that I wanted to update to a more modern
language. I ported the thing to C, but decided it was time to look
at Python more closely, so I used it to experiment with some of my
state machine building algorithms. By the end of the project, I
had fallen in love with Python as both a programming language and
a way of expressing algorithms to other programmers (who didn't
necessarily know it was Python I was writing).

--Scott David Daniels
sc***********@acm.org
Jun 15 '06 #15

P: n/a
John Salerno napisa³(a):
And I still don't get this "web application" hype, and all these "web
frameworks" scare me, as I internally don't trust any magic.


Yeah, I dabbled with CGI, but I haven't seriously looked into anything
like TurboGears yet. Of course, my problem is that I don't *need* to
learn TurboGears, Django, etc...I just feel the desire to learn them
(which is bad, in a way, because then I have no reason to use them!) And
of course learning a framework like this means learning a lot of other
parts too, like CherryPy, Mochi or something like that, etc. :)


Yea, that's right -- all these frameworks are of no use for me too. I
think I should learn at least some basics of them (like how WSGI stack
works), but my spare time is at most 2 hours at evening, so I choose
things that are closer to my current tasks, like new GUI framework (i.e.
Kiwi for PyGTK or Wax for wxPython) or new networking library.

Anyway, noone is expected to be an expert in every aspect. ;)

--
Jarek Zgoda
http://jpa.berlios.de/
Jun 15 '06 #16

P: n/a
>> I'd like something a bit like a module,
but I'd like to make several of them,
and not have them interfere with each other."


Thank you. I sense what you are saying, but at this point I'd be
thinking, "Why not just make several modules?" :) I'll get to it. I've
got my hands full just learning everything else.

rd

Jun 15 '06 #17

P: n/a
Sybren Stuvel schrieb:
John Salerno enlightened us with:
Did you have to learn it for a job?


Nope, but I do most of my job in Python nowadays. I heard rumours
about it being a nice language. After my first look at it, I was
hooked!
Also, how did you go about learning it?


I first followed the tutorial, then simply started using it. And I
watch this newsgroup to see if there are new things to learn.
Was there any necessity in the specifics you learned, or did you
just dabble in something (e.g. wxPython) for fun?


Mostly dabbling, although I learned (and improved) TLSLite because I
needed it for my graduation project.
Are there still some things you feel you need to learn or improve?


I'd love to be able to calll functions from Windows DLLs on x86 Linux.
Don't know if it'll be possible, though. Ideas anyone?


WINE? If you can run a DLL on linux, you can ultimately run a windows
python on linux I guess :)

Diez
Jun 15 '06 #18

P: n/a
Scott David Daniels wrote:
John Salerno wrote:

....
And I didn't quote him at all, so my post looks like it was
attributed to him, rather than in response to his message.

--Scott David Daniels
sc***********@acm.org
Jun 15 '06 #19

P: n/a
Scott David Daniels wrote:
Scott David Daniels wrote:
John Salerno wrote:

...
And I didn't quote him at all, so my post looks like it was
attributed to him, rather than in response to his message.


Heh heh, I thought that for a few seconds until I realized I didn't
pursue a PhD. :)
Jun 15 '06 #20

P: n/a

BartlebyScrivener wrote:
I'd like something a bit like a module,
but I'd like to make several of them,
and not have them interfere with each other."


Thank you. I sense what you are saying, but at this point I'd be
thinking, "Why not just make several modules?" :) I'll get to it. I've
got my hands full just learning everything else.

rd


To grasp the basics of OO, I strongly suggest you start with an example
of a banking application. It is in Alan Gauld's tutorial here:
http://www.freenetpages.co.uk/hp/alan.gauld/

Check the bank account class in "Object oriented programming".
I think it is a very good real-life example of how to work with
objects, and it was a real eye opener to me when I was in your
situation.

By the way, the whole tutorial is very good.

I also recommend:
Josh Cogliati's Python Tutorial for Non-Programmers
A Byte of Python

Hope it helps...
Luis

Jun 15 '06 #21

P: n/a
John Salerno wrote:

[---CUT---]
So out of curiosity, I'm just wondering how everyone else came to learn
it.

[---CUT---]

I just needed it. I needed it to recode text files from my old Atari
computer for my Linux box. I had already seen Python sources during some
googling sessions and found them mostly understandable. I also knew it
was already installed so I decided to give it a try.

One night was all I needed to write my "recoder" with nothing more to
help me than the (cryptic) included docs and the examples. Yes, 8 hours
and I had learned arguments passing, files operations, strings
manipulations and even module import with no prior knowledge. I fell in
love with Python.

I still have the source, it's very basic Python and I definitively could
have used a dictionary... but it worked.

From that moment, Python became my script language. Whenever I need to
write more than 2 lines in Bash, I use Python.

I learned the classes to play with some (rudimentary) artificial
intelligence. I even took part in a contest where I learned 'lambda' and
the generators. The only thing I haven't taken much care about is GUI in
Python. For that, I learned C++... ;-)

Any way, Python even helps me sometimes to write C++ since I use it to
test my algorithms when it comes to data manipulation. I can feed my
routines on the fly with whatever data I want to see how they react. So
I use Python as a debugger before to even start writing things in C++.
No need to compile or debug in Python. When something goes wrong:
CTRL+C, correct and restart.

Python is fun because it's easy to write, to understand and to use.

--
==================
Remi Villatel
maxilys_@_tele2.fr
==================
Jun 15 '06 #22

P: n/a
John Salerno wrote:
So out of curiosity, I'm just wondering how everyone else came to learn
[Python]


I first heard about Python in the footnotes for Bruce Eckels' book
"Thinking in Java", which I had bought for a Java course I took in
2000. Eventually, I decided to take a look at python.org, and went
through the tutorial.

Jun 16 '06 #23

P: n/a
John Salerno a écrit :
....
I do, however, think the docs are pretty good, although I sometimes find
myself just wishing that a function definition was simply laid out in an
easy to read format that included all of its parameters, so I would know
exactly what to pass to it (I guess help() is good for this though).


<mode pub="on">
http://www.limsi.fr/Individu/pointal/python/pqrc/
</mode>

A+

Laurent.
Jun 16 '06 #24

P: n/a
Ant
> No, I learned it because Perl was too dirty and Java to complicated.
Now it is part of my daily job.


Ditto. I was fed up of writing, compiling and running a java
application just in order to do a quick script. I'd used perl, but
quite frankly perl's a ridiculous language. Ruby looked promising, but
perl had already poisoned my mind against the syntax... Python was
clean, object oriented if you want it, and mature.
Also, how did you go about learning it?


Programming, reading this newsgroup, reading the python cookbook,
reading python source files of the standard library.

Are there still some things you feel you need to learn or improve?


I feel like I've got a pretty good grasp of the core language now, but
there's always something that pops up in the group that I find I've not
dabbled in (such as the itertools, which I discovered on the group last
week(?) and have been using to great effect already!).

Jun 16 '06 #25

P: n/a
John Salerno wrote:
So out of curiosity, I'm just wondering how everyone else came to learn
it. If you feel like responding, I'll ask my questions for easy quoting:

Did you have to learn it for a job?
No. My job is purely administrative; I have absolutely no need to do
any programming. I had done a *small* amount of programming (fortran,
C) while studying Physics and wrote a few simple Java applets while
teaching Physics.

Or did you just like what you saw and decided to learn it for fun?
More or less. In the summer of 2004 I felt I needed a hobby. I also
thought I should introduce my kids to something useful about computers.
I decided to combine both goals.
I started writing an html tutorial for my kids and, while surfing the
net for helpful resources, saw a few independent references to Python.
Curious, I downloaded it just to see what it was like and, after trying
a few things, I decided to forget about the html tutorial and proceeded
to write one on Python for my kids, following more or less a
traditional (boring) approach.
Also, how did you go about learning it? (i.e., like I described above, I
started with the main stuff then moved on to the different available
frameworks)
Having taught Physics for a number of years, I realised that the best
way to learn something is try to prepare to teach it to someone else.
This is what I was trying to do for my kids. But, after spending a
little over a month with Python, I stumbled upon Guido van Robot which
inspired me to change course again and I started working on RUR-PLE. I
had some ideas as to what RUR-PLE should look like, and just started
building from scratch, first implementing the logic (no GUI) and then
learning what I needed (like wxPython) as I went along. Being a
newbie sometimes made it difficult to make things work the way I
thought they should. I'm sure professional programmers/experts would
be horrified if they were to look at the details of the code I wrote.
My excuse: it works ... why break it? ;-)
Was there any necessity in the specifics you learned, or did you just
dabble in something (e.g. wxPython) for fun?
Driven by the final goal in mind... The whole adventure has been for
fun!
Are there still some things you feel you need to learn or improve?
*Lots*. At the moment, it is webserver stuff for another project
(Crunchy Frog), again designed to make teaching/learning Python more
fun.
Additional comments/complains here: :)


Programming in Python is fantastic as a hobby... when I can find the
time. Since I started 2 years ago, I have gone for a few weeks (and
once for 4 months) at a time without doing any programming. However,
it is always easy to get back at it. I don't think I'd be able to say
that with other languages.

I have found members of the Python community to be generally extremely
helpful and generous of their time, in answering my silly questions.

I sometimes wish I had a different job, one which required me to do
programming using Python.

André

Jun 16 '06 #26

P: n/a
Thus spoke John Salerno (on 2006-06-15 15:50):
Did you have to learn it for a job?
No, I was just interested in things
that are found interesting ;-)
Or did you just like what you saw and decided to learn it for fun?
I read some remarks, from "both sides", on
the feasibility of a programming language
with 'invisible braces', so I thought
'give it a try'.
Also, how did you go about learning it? (i.e., like I described above, I
started with the main stuff then moved on to the different available
frameworks)
Good question: I started with 'Myghty', this is,
as you probably know, a (imho excellent) framework
for developing web applications from components.

'Myghty' is a almost complete port of Perl's 'Mason'
(which is what Amazon and others run at), - what I
knew already smoehow.

I also tried Pylons (base component of MVC system
for web apps), but waved the flag after some time.
Was there any necessity in the specifics you learned,
or did you just dabble in something (e.g. wxPython) for fun?
Another motivation was to find out something about the
(nowadays) huge amount on SciPy related (software
(http://www.scipy.org/Topical_Software).
Are there still some things you feel you need to learn or improve?
I came all the way up from Basic/Fortran/x86-Assembler/C/C++
to todays 'lightweight languages' (Dr.Dobbs says they are)
in the the Python/Perl/Ruby-Group.

For my personal taste(!), Python is in the end
'to unspectacular', means: I didn't manage to
learn to be really expressive in it - and to
enjoy that ;-)

But thats a matter of taste, these languages are like
weapons (tools), that you use to express yourself on
the battlefield of your tasks.

And you _have_ to love and praise your sword, otherwise
you won't be able to handle it appropriate - in your
dreadful encounters ...
Additional comments/complains here: :)


What I don't like in Python
- easy things are too easy (even beginners can handle that, PIL etc.),
- complicated things are too complicated (I had hard times to remember things),
- invisible braces ;-) (just personal taste)
- no integrated regex support (used to use re's very much, but milage my vary)

Regards

Mirco
Jun 16 '06 #27

P: n/a
BartlebyScrivener wrote:
(snip)
Also, it seems to be a minimalist
language.


*seems* minimalist, but is really not - have a look at the object model
(metaclasses, descriptors etc), at closures and HOFs and decorators, at
list-comp and generators and (coming in 2.5) coroutines... Definitively
not minimalist in fact !-)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Jun 16 '06 #28

P: n/a
BartlebyScrivener wrote:
I'd like something a bit like a module,
but I'd like to make several of them,
and not have them interfere with each other."

Thank you. I sense what you are saying, but at this point I'd be
thinking, "Why not just make several modules?" :)


Because you want an unknown number of the *same* module ?-)

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Jun 16 '06 #29

P: n/a
Scott David Daniels wrote:
BartlebyScrivener wrote:
.... I am not touching OO, classes, or GUIs until I understand
EVERYTHING else. Could take a few years. ;)

You know how modules separate globals, right? That is, what you
write in one module doesn't affect the names in another module.
What classes (and hence OO) give you is a way of saying, "I'd
like something a bit like a module, but I'd like to make several
of them, and not have them interfere with each other." That is
the big intuition about objects, the rest is just details.


Another way to put it:

You know what are dicts, right ? That is, containers with keyword-access
to values ? Then you probably have dicts with a known, defined
structure, and functions working on it. What classes (and hence 00)
gives you is a way to associate these functions with the dicts
themselves. That is the big intuition about objects, the rest is just
details.

!-)

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Jun 16 '06 #30

P: n/a
BartlebyScrivener wrote:
(snip)
I am not touching OO, classes,
You may not be aware of this, but as soon as you're programming in
Python, you *are* using OO. Strings are objects, dicts are objects,
tuples are objects, lists are objects, numbers are objects, and even
functions and modules are objects. Classes are just a way to create your
own object types.
or GUIs until I understand EVERYTHING


The answer is 42. That's all you need to know.

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Jun 16 '06 #31

P: n/a
Dave Opstad <da*********@monotypeimaging.com> wrote:
In article <jA******************@news.tufts.edu>,
John Salerno <jo******@NOSPAMgmail.com> wrote:

I had retired from Apple in 2001 after 33 years in the business, feeling
completely burned out. Didn't want to even look at another line of code.
After resting and recuperating for a couple years, though, I picked up a
book on Python (Alex Martelli's wonderful "Python in a Nutshell") and


Hey, great, I'm glad you liked it!
Alex
Jun 17 '06 #32

P: n/a
BartlebyScrivener <rp*******@gmail.com> wrote:
...
Especially the Python Cookbook, as I don't normally 'get it' when
someone just describes theory or an abstraction, I also must see an
example. The examples in the Cookbook are useful and also come with
explanations about how they work. Same goes for this group. Nine times


Yes, I agree that the Cookbook is particularly advisable for readers who
learn best from/via examples. Other very example-rich books include
Mark Pilgrim's and Magnus Lie Hetlands', by the way.
Alex
Jun 17 '06 #33

P: n/a
John Salerno wrote:
(snip)
So out of curiosity, I'm just wondering how everyone else came to learn
it. If you feel like responding, I'll ask my questions for easy quoting:

Did you have to learn it for a job?
It has never been an official requirement for any of the jobs I got
since I'm a programmer, if that's what you mean. I discovered it while
learning C++ / wxWidgets (someone talked me about Python as being pretty
good for rapid prototyping).
Or did you just like what you saw and decided to learn it for fun?
Well, I haven't be really impressed the first time - note that it was at
the very end of the last century, with v1.5.2. But still I found the
language suprisingly simple to get up and running with - seemed like the
language was almost always reading my mind about how I would have named
a librairy, function or whatever !-) So I ended up using it more and
more when wanting to play with an idea or write a quick script... Until
I realised than it was not the toy language I first thought it was (my,
no access restrictors, not static typing, this just could not be a
serious language, could it ?-), but a fantastic application programming
language - far better than anything I had seen before (mostly 'modern'
basics, C, C++, Pascal and Java...).
Also, how did you go about learning it? (i.e., like I described above, I
started with the main stuff then moved on to the different available
frameworks)
Just used it, played with it, and lurked here.
Was there any necessity in the specifics you learned, or did you just
dabble in something (e.g. wxPython) for fun?
I first used it for scripts, then turned to web programming (job
opportunity), so I never really went very far in GUI programming with
Python.
Are there still some things you feel you need to learn or improve?


Yes - all and everything...
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Jun 17 '06 #34

P: n/a
In 2002, I was in need of a multi-platform language. My choice became
Python, in spite of friends fiercly defending Perl and some interesting
Slashdot-articles on Ruby. But back on university, I met a very, very
pretty C++ girl who said many favourable things about Python. She never
became mine, but the sympathy for Python that she implanted in my mind,
turned out to make me immune against the Perl propaganda.

So Python (for me) could be said to be either a substitute for the
prettiest of the (many) pretty girls of Norway or a mindchild of the
same.

I found a script demonstrating search/replace in files. And even if I
hadn't coded in a year, I found Python surprisingly easy to read,
understand and change. So there I was.
Did you have to learn it for a job?
No, but I use it as often as possible in work contexts.
Or did you just like what you saw and decided to learn it for fun?
That's more like it.
Also, how did you go about learning it?
I ported som other scripts (Bash, PHP, and DOS bat-files) to Python
while searching the net each time I became lost. Porting is a good
learning method.
Was there any necessity in the specifics you learned,
or did you just dabble in something
(e.g. wxPython) for fun?
Mostly fun and some practical problems. Later I've used Boa Constructor
to make GUI's for some customers.
Are there still some things you feel you need to learn or improve?
Sure, I struggle with OO when it gets complicated and new features like
decorators. And idioms. But generally it's programming skills and
algorithmic scent I need.
Additional comments/complains here: :)


I'm a bit afraid that the new features and the turning to concepts like
iterators and generators are making Python elitistic. Old python code
floating around the net is generally easy to read, while newer often is
harder to grasp. I don't like it when my own inherent stupidity becomes
to obvious to hide.

Jun 17 '06 #35

P: n/a
Thus spoke Sybren Stuvel (on 2006-06-17 22:01):
Rune Strand enlightened us with:
But back on university, I met a very, very pretty C++ girl who said
many favourable things about Python.


Rrrrrr a very, very pretty girl that likes C++ and Python.
Does it get better?


It does:
http://www.cafepress.com/buy/python/...35/id_7539588/

Regards

Mirco

Jun 17 '06 #36

P: n/a
bruno at modulix wrote:
Or did you just like what you saw and decided to learn it for fun?


Well, I haven't be really impressed the first time - note that it was at
the very end of the last century, with v1.5.2.

1.5.2 was an excellent version. Not really that different in use than
current version.
--

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science

Phone: +45 66 11 84 94
Mobile: +45 29 93 42 96
Jun 19 '06 #37

P: n/a
Bruno wrote:

8<------------(snip)--------------

| The answer is 42. That's all you need to know.
Right on, Ford Prefect !!!

What's for Lunch?

- Hendrik
Jun 19 '06 #38

P: n/a
Max M wrote:
bruno at modulix wrote:
Or did you just like what you saw and decided to learn it for fun?

Well, I haven't be really impressed the first time - note that it was at
the very end of the last century, with v1.5.2.


1.5.2 was an excellent version. Not really that different in use than
current version.


Nope, "not really that different" - we were just missing list-comps,
generators, new-style classes, classmethods, staticmethods, usable
metaclasses, descriptors, @decorators sugar, extended slices, and a few
other goodies coming in 2.5 like coroutines and with: statement...
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Jun 20 '06 #39

P: n/a
bruno at modulix wrote:
Max M wrote:
bruno at modulix wrote:
Or did you just like what you saw and decided to learn it for fun?

Well, I haven't be really impressed the first time - note that it was at
the very end of the last century, with v1.5.2.

1.5.2 was an excellent version. Not really that different in use than
current version.


Nope, "not really that different" - we were just missing list-comps,
generators, new-style classes, classmethods, staticmethods, usable
metaclasses, descriptors, @decorators sugar, extended slices, and a few
other goodies coming in 2.5 like coroutines and with: statement...

I wrote "different in use". Which is not the same as saying it has not
changed. The general feel of coding in Python is exactly the same to me.

I believe that most of those changes you mention are rarely used by most
programmers.
--

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science

Phone: +45 66 11 84 94
Mobile: +45 29 93 42 96
Jun 20 '06 #40

P: n/a
Max M wrote:
bruno at modulix wrote:
Max M wrote:
bruno at modulix wrote:

> Or did you just like what you saw and decided to learn it for fun?
Well, I haven't be really impressed the first time - note that it
was at
the very end of the last century, with v1.5.2.

1.5.2 was an excellent version. Not really that different in use than
current version.

Nope, "not really that different" - we were just missing list-comps,
generators, new-style classes, classmethods, staticmethods, usable
metaclasses, descriptors, @decorators sugar, extended slices, and a few
other goodies coming in 2.5 like coroutines and with: statement...


I wrote "different in use".


Yes. It just happens that all this really changed a lot the way I use
Python (and the way I design and program in general).
Which is not the same as saying it has not
changed. The general feel of coding in Python is exactly the same to me.
AFAIC, the overall feeling that the language helps me instead of getting
in the way is still here, of course !-)
I believe that most of those changes you mention are rarely used by most
programmers.


Too bad for them then. Not that I use all of these nice features all the
time, but I have a use case for at least one of them almost everyday -
and I do miss them when using other languages.

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Jun 20 '06 #41

P: n/a
>>> You know what are dicts, right ? That is, containers with
keyword-access to values ? Then you probably have dicts
with a known, defined structure, and functions working on
it. What classes (and hence 00) gives you is a way to
associate these functions with the dicts themselves. That
is the big intuition about objects, the rest is just
details.


You bet. I have lots of these. Especially a large dictionary that is
kind of an application and site launcher. I type "l clp" at the command
line, and l.py runs a function def launch(obj), which grabs the key
"clp" whose value is this site address, and I'm browsing clp. Kind of
like favorites with no mouse. Or another dictionary with applications.
Same way. They work fine. I guess they aren't complex enough to require
classes yet?

I appreciate the tips. I'll do a couple tutorials and read my books and
then come back with any OO questions.

Thanks Bruno and Luis.

rd

Jun 21 '06 #42

P: n/a
John Salerno wrote:
Did you have to learn it for a job?
No, for me, programming is primarily a hobby. I worked on scientific
programming in Fortran in the 1980s and in C in the 1990s. Later I
did some sys admin work, and managed to use a bit of Python in that.
Or did you just like what you saw and decided to learn it for fun?
I became interested in creating a free software graphic adventure
game, and we needed a scripting language. A collaborator heavily
favored Python, and so I checked it out.

I was a stay-at-home Dad at the time, so I had time to work on
projects. But I also had to juggle kids. So a programming language
like C that required me to "hold a lot of state in my head" was
unworkable. When you're watching kids, you have maybe 5-10
minutes between interruptions, so you need to be able to
recover your place in seconds. Python makes that more
possible than any other language I've seen.

At first I was suspicious of the significant whitespace. But I
quickly realized the brilliance of it -- it makes the computer queue
on the same thing my eyes use to recognize code-blocks, so it's
virtually impossible to have an ambiguous code-block bug.

In fact, I was stunned at how many common bugs you just can't
have happen in Python (of course, later on I discovered a few that
it specifically enables, but well, there's no such thing as a perfect
solution).
Also, how did you go about learning it? (i.e., like I described
above, I started with the main stuff then moved on to the different
available frameworks)
I picked up a copy of Learning Python from O'Reilly books. I went
through it in three days -- easily record-breaking time for me to
learn a new computer language. Of course, I didn't learn *everything*
in that time, but I learned enough to write useful stuff in it. That
sold me on it -- it was obviously the right language for me to be
using.
Was there any necessity in the specifics you learned, or did you just
dabble in something (e.g. wxPython) for fun?
Well, as I said, I started on a game project. Later on, I spent a lot
of time using Zope and working on a big-concept CMS design. I think
I was way out of my depth actually. I'm considering extending Plone
to do what I need, now, but I haven't really had a chance to look
at it.
Are there still some things you feel you need to learn or improve?


Of course!

* I am working on combining auto-generated documentation with
pre-written overview documentation to get the 'best of both worlds'
documentation for the code.

* I am trying to better understand and use testing methodologies. Testing
is hard to get in the habit of doing, because it requires forethought --
testing is work you do now, during early development, that saves you
tons of time later on, when you are supporting and improving the
software. So it's requires some discipline to spend that extra up-front
time (even though you know it's going to save you later).

* There will always be modules you don't know yet (and more are being
written). In particular, I'm looking into installing and extending
Plone.
I also need to learn more about XML processing and other stuff I'm
going to need for processing vector graphics.

* I still haven't totally gotten my head around GUIs, nor PyGame (which
is back to the game project) though I'm getting closer to my goals.

Regrettably, though, it's still a hobby, and I have less time even than
I used to. Even though I still stay at home, I have a full time writing
workload now, and it's become a little difficult to find enough time
for programming. Once again, though, Python's ease of readability
really helps me to pick up where I left off when I have to do that (which
is a lot).

Cheers,
Terry
--
Terry Hancock (ha*****@AnansiSpaceworks.com)
Anansi Spaceworks http://www.AnansiSpaceworks.com

Jun 21 '06 #43

P: n/a
BartlebyScrivener wrote:
You know what are dicts, right ? That is, containers with
keyword-access to values ? Then you probably have dicts
with a known, defined structure, and functions working on
it. What classes (and hence 00) gives you is a way to
associate these functions with the dicts themselves. That
is the big intuition about objects, the rest is just
details.


You bet.


No big deal. Using dicts to organize data is quite obvious, and then you
need to operate on these data, so you write functions using these dicts...
I have lots of these.
Especially a large dictionary that is
kind of an application and site launcher. I type "l clp" at the command
line, and l.py runs a function def launch(obj), which grabs the key
"clp" whose value is this site address, and I'm browsing clp. Kind of
like favorites with no mouse. Or another dictionary with applications.
Same way. They work fine. I guess they aren't complex enough to require
classes yet?
Nothing really *requires* classes if you go that way. Now going from
dicts+functions to classes+methods is quite a no-brainer, and can really
ease maintenance. Once you'll be there, you'll probably find yourself
shifting to a more OO style (small decoupled methods, polymorphic
dispatch etc) swithout even noticing. You don't have to learn all the
voodoo stuff about OO to start using OO in Python - but if you already
made the move from strictly procedural (dicts/lists/tuples + functions)
to ADTs (simplest use of classes), you'll be happy to have the whole
power of Python's object model when the need arise.
I appreciate the tips. I'll do a couple tutorials and read my books and
then come back with any OO questions.


You're welcome. FWIW, a good exercice would be to take one of your own
programs and try to gradually transform dicts+related funcs to classes.

My 2 cents
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Jun 21 '06 #44

P: n/a
John Salerno wrote:
Did you have to learn it for a job?
No, although it became useful once I learnt it.
Or did you just like what you saw and decided to learn it for fun?
I saw Bruce Eckel mention it in "Thinking in Java, 2nd ed." as
"something that was slowly becoming his favorite programming language".
How would *you* react to that? :)
Also, how did you go about learning it? (i.e., like I described above, I
started with the main stuff then moved on to the different available
frameworks)
I started with the tutorial, although I didn't read it end-to-end. Then
I toyed a little with DB API (MySQLdb). It came useful some two weeks
after installing Python, when I was doing some DB refactoring in the
(Java) app I was working on at the time. Compared to JDBC, Python DB
API is very lightweight, which also taught me how not to overdesign.

Later I learnt Tkinter when I wrote a tool for some admin tasks on that
DB. I was to lazy to do it in Java.
Was there any necessity in the specifics you learned, or did you just
dabble in something (e.g. wxPython) for fun?
See above.
Are there still some things you feel you need to learn or improve?
Metaclasses and other magic, if I ever need that stuff. Otherwise,
design and algorithms - these are not Python-specific, but Python can
be a useful learning tool here.
Additional comments/complains here: :)


Every XML API for Python that I tried sucks in one way or another. Try
manipulating a document with multiple namespaces, you'll know. Not that
I ever saw any XML API in any language that would do everything I
expected from it correctly. Ergo, XML sucks. :)

Cheers,

AdSR

Jun 21 '06 #45

P: n/a
> You know what are dicts, right ? That is, containers with keyword-access
to values ? Then you probably have dicts with a known, defined
structure, and functions working on it. What classes (and hence 00)
gives you is a way to associate these functions with the dicts
themselves. That is the big intuition about objects, the rest is just
details.


Bruno,

Ever seen this from Fuzzyman? It explicitly uses the dict comparison.

http://www.voidspace.org.uk/python/a...l#introduction

Thanks for the tip,

rd

Jun 26 '06 #46

P: n/a
BartlebyScrivener wrote:
You know what are dicts, right ? That is, containers with keyword-access
to values ? Then you probably have dicts with a known, defined
structure, and functions working on it. What classes (and hence 00)
gives you is a way to associate these functions with the dicts
themselves. That is the big intuition about objects, the rest is just
details.

Bruno,

Ever seen this from Fuzzyman? It explicitly uses the dict comparison.

http://www.voidspace.org.uk/python/a...l#introduction


Nope - and the site seems to be down actually. But thanks for the
pointer anyway.
Thanks for the tip,


Welcome to OO !-)

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Jun 27 '06 #47

P: n/a
Bruno Desthuilliers wrote:
Ever seen this from Fuzzyman? It explicitly uses the dict comparison.

http://www.voidspace.org.uk/python/a...l#introduction


Nope - and the site seems to be down actually. But thanks for the
pointer anyway.


It works for me, at least now.
Jun 27 '06 #48

This discussion thread is closed

Replies have been disabled for this discussion.