http://forums.macrumors.com/showthread.php?t=477303
type your command at the SHELL PROMPT not Python interpreter prompt: open Terminal, 'cd' to your python script directory and type
If you want to execute python module in the interactive Python shell:
start python by typing
$ python
and type
without '.py' file extension.
Your problems originates in mixing UNIX bash shell and interactive Python shell.
type your command at the SHELL PROMPT not Python interpreter prompt: open Terminal, 'cd' to your python script directory and type
Code:
$ python spam.py
start python by typing
$ python
and type
Code:
>>> import spam
Your problems originates in mixing UNIX bash shell and interactive Python shell.