Getting started with python

Basilisk96 basilisk96 at gmail.com
Wed Apr 18 00:00:17 EDT 2007


On Apr 14, 8:46 pm, "Eric" <erichapk... at gmail.com> wrote:
> Hello, after reading some of the book Programming Python it seems that
> python is something I would like to delve deeper into. The only thing
> is, I have no idea what I should try and write. So I was hoping that
> someone here could help point me to a group/project that would be a
> good starting place for a person with limited python knowledge, but
> that is willing to learn whatever is necessary. I'm hoping that with a
> goal I can start to learn python instead of just playing around with
> it. Thanks.

Eric,

You will certainly appreciate how concise and easy Python is.
I am also relatively new to Python (started about a year ago), and I'd
rather not go back to any other language! Why would I want to torment
my not-so-quick typing fingers?? :)  I'm a self-learner. I learn by
reading, by example, and by doing.

Here is a list of suggestions. Start with simple things, grow
confident, and move on to more interesting stuff as you progress:

At the Python command line, type "import this" to see the basic ideas
behind Python development. It begins with "Beautiful is better than
ugly." - a nice thought.

1. First of all, read the publication "How to Think Like a Computer
Scientist: Learning with Python" by Allen B. Downey et al.  I have
found this little gem to be very, very useful when I first got
interested in Python and thought to myself, "how do I go about
learning this, where do I start??".  Highly recommended. I read it
from start to finish in a couple of days and started making useful
scripts right after that.  The author actually implements a simple
card game toward the end of the book, using all the knowledge from the
previous chapters.  The text is available at:
http://www.ibiblio.org/obp/thinkCSpy/

2. Play with Python from the command line first, using PyShell,
PyCrust, or any of its other siblings that come with the wxPython
package (a GUI toolkit - see #8 below).  You will find the code
completion feature and the syntax helper quite useful.

3. Tinker around with the builtin modules.  There's a lot of built-in
functionality in Python right out of the box. Try the "os" and "sys"
modules to experiment with filesystem handling. Try reading and
writing text files, as this is quite a common task with a variety of
applications. Try the "struct" module for binary file processing.  Try
the "urllib" and "urllib2" modules for loading and processing Web
pages... I could go on, but you get the idea.

4. If you have a text processing background, dip your hand in regular
expressions with the "re" module. Maybe you have a need for extracting
some statistical data from a financial report, and this might be one
way to do it.

5. If you have a mathematical background, download and install the
NumPy or SciPy package and do some wild matrix math!

6. I have recently tinkered with the Pymedia package, perhaps you want
to try it later on.  It is a nice tool for dealing with audio - for
recording, encoding, decoding, spectrum analysis, etc.  In just a few
hours, I came up with a nice voice-activated MP3 sound recorder
application.

7. If you feel brave and want to work with Windows COM client/server
stuff (assuming Windows is your platform), get the PythonWin package,
also known as "win32com" and try to read/write Excel, Word files,
etc., or whatever

8. Last but certainly not least, once you feel comfortable with basic
Python, try GUI development.  Several gui toolkits are out there.
wxPython is a good one to start with, though you may find some others
to your liking.

9. If you have previous programming experience, try taking an
application you've developed before and port it to Python.  See how
much your code base shrinks compared to its C++ or Java counterpart :)
But really, do it just to understand Python on a deeper level. Instead
of thinking in the old way, try to think in the Pythonic way.  A nice
example of this is iteration.  Where an iteration counter variable is
required in most other languages, Python inherently supports iteration
in sequence objects like lists, strings, and dictionary keys; so the
syntax is simpler in most cases.

-Basilisk96




More information about the Python-list mailing list