Any advice for a beginner?

Preston Landers planders at mail.utexas.edu
Sat May 29 21:43:53 EDT 1999


"Simon Speichert" <spdl23 at hotmail.com> writes:

> My point is this; it's a *huge* language, and I have no idea where to start.
> I'm past "Hello, world!" and I don't know where to go next. Any advice would
> be much appreciated.

Well, I guess it all depends on what you want to do! :-)

Seriously, my advice to you is to identify some kind of project or
goal and work towards it and learn Python along the way.

It doesn't have to be a reimplentation of Emacs or anything especially 
fancy, and it certainly doesn't matter if anyone's already implemented 
a version of what you want to do either in Python or another language.

A bit more than a year ago, I sat down and read the Python tutorial,
and then I was about at the same point you were.  I thought, "gee,
this is a neet language, but what am I going to use it for?"

Then not much happened for a couple of months until one day I got
struck on the head by a flat stone and decided that I would
reimplement Slashdot.org's code.  (Mainly because I had tried to use
the actual slash code but found it nearly unusable.)  Only then did it 
occur to me that Python would be excellent for that task.

Well since then I've been working on it off and on (life and other
[paying] projects tend to interfere.)  But I did get a working version 
online, one that actually *looks* and mostly works like Slashdot.  At
first it was just a quick and dirty hack (and it mostly still is) but
I plan to clean it up this summer and release it.  

The thing is, it did teach me Python.  I started small, just writing a 
simple module that would display fields from an SQL database in a
simple HTML table.  Then I worked my way up from there.  (By the way,
I used to have a demo site running this program but it's going to be
offline for the next month or so... when it's back up I'll post here.)

So to you I suggest finding a little project and trying to code it up
one piece at a time.  It might help *not* to have grandiose visions of 
what the final product will do, like I did.  Just identify a problem,
break it up into discreet steps / modules, and work on each step /
module one at a time.

I can't really give you any suggestions for what to work on; that
entirely depends on your temperment and desires.  Is there any kind of
system administration problem you would like solved?  Recently I
decided there wasn't a good facility for searching Debian's (Linux)
availible package archives, so I wrote one.  (It's actually decently
implemented.  I use it myself all the time but I haven't released it
yet mainly because no one seems to have any interest. [hint hint])

I've also noticed that as I went along, my Python style kept getting
better and better.  At first I was used to a C style mindset but now I 
find myself programming in more 'natural' Python and using the
sequence and dictionary types more often and more efficiently.  Python 
is such a wonderful and flexible language that you can have bad style
and still get results, but using it a while does promote good style
(which is subjective, but...) 

Don't be afraid of the documentation! ;-)  I've found the library
reference to be *extremely* helpful even if it doesn't provide many
examples which are helpful.  The Python Documentation page rightly
says "keep this under your pillow."

Another important thing is to read other people's code.  When I was first
starting out I couldn't find too many good examples of the kind of
things I wanted to do.  I hope you will have more luck.  

Since my chosen problem domain is generally internet programming, I've 
found the book "Internet Programming with Python" (coauthored by
Guido) to be quite helpful even if it is a bit outdated now.  It does
offer a lot of general information on Python any beginner is likely to 
find useful even if not doing specifically internet related stuff.

So to sum this long winded message up, find a problem and hack on it!

And don't be afraid to post to the newsgroup either!

Good luck!

---Preston




More information about the Python-list mailing list