Non-Programmer's Tutorial for Python 2.6/FAQ

Question: Can't use programs with input.
Answer: If you are using IDLE then try using command line. This problem seems to be fixed in IDLE 0.6 and newer. If you are using an older version of IDLE try upgrading to Python 2.0 or newer.
Is there a printable version?
Yes, see the next question.
Is there a PDF or zipped version?
Yes, go to http://www.honors.montana.edu/~jjc/easytut for several different versions. Note that this will not always be up to date with the Wikibooks version. The Wikibook can be printed from the print version.
What is the tutorial written with?
Originally, LaTeX, see the easytut.tex file.
I can't type in programs of more than one line.
If the programs that you type in run as soon as you are typing them in, you need to edit a file instead of typing them in interactive mode. (Hint: interactive mode is the mode with the >>> prompt in front of it.)
My question is not answered here.
Ask on the talk page. Please post source code if at all relevant (even, (or maybe especially) if it doesn't work). Helpful things to include are what you were trying to do, what happened, what you expected to happen, error messages, version of Python, Operating System, and whether or not your cat was stepping on the keyboard. (The cat in my house has a fondness for space bars and control keys.)
I want to read it in a different language.
There are several translations that I know of. One is in Korean and is available at http://home.hanmir.com/~johnsonj/easytut/easytut.html. Another is in Spanish and at http://www.honors.montana.edu/~jjc/easytut/easytut_es/. Another is in Italian and is available at http://www.python.it/doc/tut_begin/index.html. Another is in Greek and available at http://www.honors.montana.edu/~jjc/easytut/easytut_gr/. Several people have said they are doing a translation in other languages such as French, but I never heard back from them. If you have done a translation or know of any translations, please either send it to me or send me a link.
How do I make a GUI in Python?
You can use either TKinter at http://www.python.org/topics/tkinter/ or WXPython at http://www.wxpython.org/
How do I make a game in Python?
The best method is probably to use PYgame at http://pygame.org/
How do I make an executable from a Python program?
Short answer: Python is an interpreted language so that is impossible. Long answer is that something similar to an executable can be created by taking the Python interpreter and the file and joining them together and distributing that. For more on that problem see http://www.python.org/cgi-bin/faqw.py?req=all#4.28. A project that does make executable python files is py2exe - see http://www.py2exe.org.
I need help with the exercises
Hint, the password program requires two variables, one to keep track of the number of times the password was typed in, and another to keep track of the last password typed in. Also you can download solutions from http://www.honors.montana.edu/~jjc/easytut/
What and when was the last thing changed?
  • 2000-Dec-16, added error handling chapter.
  • 2000-Dec-22, Removed old install procedure.
  • 2001-Jan-16, Fixed bug in program, Added example and data to lists section.
  • 2001-Apr-5, Spelling, grammar, added another how to break programs, url fix for PDF version.
  • 2001-May-13, Added chapter on debugging.
  • 2001-Nov-11, Added exercises, fixed grammar, spelling, and hopefully improved explanations of some things.
  • 2001-Nov-19, Added password exercise, revised references section.
  • 2002-Feb-23, Moved 3 times password exercise, changed l to list in list examples question. Added a new example to Decisions chapter, added two new exercises.
  • 2002-Mar-14, Changed abs to my_abs since python now defines a abs function.
  • 2002-May-15, Added a faq about creating an executable. Added a comment from about the list example. Fixed typos from Axel Kleiboemer.
  • 2002-Jun-14, Changed a program to use while true instead of while 1 to be more clear.
  • 2002-Jul-5, Rewrote functions chapter. Modified fib program to hopefully be clearer.
  • 2003-Jan-3, Added average examples to the decisions chapter.
  • 2003-Jan-19, Added comment about value of a_var. Fixed mistake in average2.py program.
  • 2003-Sep-5, Changed idle instruction to Run->Run Module.
  • 2004-Jun-1, Put on Wikibooks
  • Since then all changes are visible through the Wikibooks version keeping system.