Iwanna Learn Python

Good for you. PythonLanguage is easy to learn, very expressive and powerful, and extremely popular and well-supported.

Online tutorials:

Printed books:

Get yourself a printed book too, for carrying around and reading at odd moments (or in bed). The following general-purpose Python books are arranged newest to oldest.

Wikis and groups:

Portals & online journals:

Other online resources:

Special interest:


Older book reviews:

Read DavidMertz's reviews of Python books at http://www-106.ibm.com/developerworks/linux/library/l-pbook3.html (within the page there are links to earlier book review lists)

The reviews are worth reading. (I, personally, think Quick Python Book is the best for the beginners and Python Essential Reference for the veterans.) -- JuneKim

The same site has lots of material suitable for people interested in PythonXml.

DavidMertz is very into FunctionalProgramming. Several articles in his "Charming Python" column are about FP in Python, even articles that don't mention FP in their titles. In addition, a good part of an early chapter in his Text Processing in Python book addresses FP.

The only Python book which I've bought was Andre Lessa's Python Developer's Handbook, which is mentioned in Mertz's review, but not reviewed itself. It's somewhat larger than most other Python books I've seen, with the possible exception of the Core book, and tackles things from a beginner's perspective. A large part of the book is dedicated to certain tasks you might use Python in, and a comprehensive annotated list of useful Python modules, as well as sample code on how to use certain modules in certain contexts. Lessa's native language is not English, but the book is written well, and suffers from very few odd turns of phrase, and is well worth looking at. -- DanMoniz


IwannaLearnPython QuickQuestions

Q Cygwin and its Python package. Is that combination any good? It says there are Python 2.3.3-2 and 2.3.4-2 stuff. Is that a good Python for beginners?

A Taken from VisualBasicSuitableForDevelopment Python with py2exe, using a gui toolkit like WxWidgets/WxPython or even tk or gtk is another viable alternative.

Q Python CGI under WindowsXp. Need expert help to see whether steps to setup Python cgi for windows95, located at http://starship.python.net/crew/aaron_watters/pws.html is still relevant to WindowsXp. Seems odd one has to directly manipulate registry files.

A I'd hope not. You could try using Apache + mod_python - http://httpd.apache.org/modules/python-download.cgi

GoogleKnowsEverything - "IIS Python" gives <http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B276494> ... You could have done that ;-P Q More on Python GUI bindings. What about Tk Gui binding for Python (read in ToolCommandLanguage, and found Tk Inter link at http://www.python.org/moin/TkInter). I presume it is available for WindowsXp (?PocketPc) and behaves well (not like X windows). What pros and cons compared to alternatives?

A Tk works "fine" on Windows XP, but my personal bias is that Tk is crappy even at it's best. WxPython works great on Windows XP. If you can afford a commercial license for Qt and PyQt?, that works great too. If you want something higher level than WxPython, try PythonCard. There's also pywin32, which you can use to access MFC and the Win32 API directly, but I wouldn't use this unless you've got a lot of C/C++ experience with MFC (common), and are really in love with it (far less common). --cm

Q PythonCard page here was last updated in 2002. WhatHappened to that project in terms of major changes in the interim years? I am asking the question on this page so people can see a QuickDiff of the PythonCard. Maybe "someone in the know" can update that page with the info on the current release (0.81 see http://sourceforge.net/project/shownotes.php?group_id=19015&release_id=276425) and give some indication as to what major limitations/bugs exist and its alternatives?

A


Since I am trying to learn python, and this page, while offering many links, does not give any direct help, I thought I would share the absolute basic, which to me is open a file and run. This was not as straightforward as it seems. I made a file called test.py with a function called go() then tried

  import test.py

which did not work, then

  import test

which did, but then typed go(), which did not work. Finally after slogging through the tutorial I found further down (http://docs.python.org/tut/node8.html the fibo.py example) you have to reference the filename so

  test.go()

Worked. From there it should be a matter of CopyAndPaste from examples. Hope this helps save someone else time.

''Some clarification for why this worked/didn't work:

"import" imports a module. Modules are referenced by abstract name, not filename (putting a path in there won't work either). Modules are also imported into their own namespace. You can alias the modules namespace by using import as - import test as mytest will create load the module test into the namespace mytest. You can also import directly into the global namespace (although this is not recommended) using the from import syntax - from test import go will load the symbol go from the module test into the global namespace. This also works with a wildcard - from test import * loads all symbols from the module test into the global namespace. This use is not considered best practice.''

I am also trying to use PipPy on the palm, at first when I tried a for loop in the "command line"/eval it kept giving errors even though it seemed very simple:

  for x in [1,2,3]:
    print x

Then I pressed enter after the last x and it worked. I am now heading over to PythonWhiteSpaceDiscussion. In PipPy it is even worse trying to load files, you have to do

  import memoimp;memoimp.install()

But then it seems to work same as using import file in the windows Python command line interpreter above. file is a Python category memopad file with #filename.py at the top. I deliberately have not tried the windows GUI IDE yet as I want to use both palm and desktop so am using the environment that is similar on both.


CategoryBooks, CategoryPython, IwannaLearn


EditText of this page (last edited April 9, 2009) or FindPage with title or text search