You are trying to run your Python program file from the Python shell. That does not work!
Use one of the many good Python IDEs like PyScripter or IDLE, write your program in the associated editor and run it from there.
See:
http://www.daniweb.com/forums/post104834-1.html
If you use Python30, adjust your print to print() accordingly.
BTW, do us all a favor and use the customary 4 space indentation, makes your code much more readable,
This code should work with Python30 ...
# modified for Python30
def main():
print("Hello World")
main()
# make console window wait
input("Press Enter to go on ... ")
Save your code as hello.py. If you use the Windows OS you can also doubleclick on your filename hello.py to make it run.
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417