Hey, everyone, I am new to programming and just downloaded Python 2.6 onto my windows vista laptop. I am attempting to follow 4.11 of the tutorial called "How to Think Like a Computer Scientist: Learning with Python v2nd Edition documentation" ( http://openbookproject.net/thinkcs/python/english2e/ch04.html). However, I am having some trouble. First off, I do not understand how to import things into the python shell. I have a script I saved as chap03.py, but when I try to import it into the python shell i get an error like this:
>>> from chap03 import * Traceback (most recent call last): File "<pyshell#8>", line 1, in <module> from chap03 import * File "C:/Python26\chap03.py", line 2 print param param ^ SyntaxError: invalid syntax >>> The chap03.py file is a simple one that looks like this: def print_twice(param): print param param My second problem is that I need to install and import GASP in order to follow the tutorial. When I tried to do import it, I ran into an error like this: >>> from gasp import * Traceback (most recent call last): File "<pyshell#9>", line 1, in <module> from gasp import * File "C:\Python26\lib\site-packages\gasp\__init__.py", line 1, in <module> from api import * File "C:\Python26\lib\site-packages\gasp\api.py", line 1, in <module> import backend File "C:\Python26\lib\site-packages\gasp\backend.py", line 7, in <module> except ImportError: raise 'Pygame is not installed. Please install it.' TypeError: exceptions must be old-style classes or derived from BaseException, not str >>> Can anybody help me with this? Thanks a lot P.S. SORRY FOR THE LONG EMAIL
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor