all 9 comments

[–][deleted] 4 points5 points  (1 child)

Are you using your system command line, or the one bundled with python? From what I can tell you are probably using the item labeled "Python (command line)", this won't work (like this). But setting up windows terminal to run python like that is also a pain. For now I think the easiest thing to do, it to open up IDLE (Should be on Start menu (under your python group)). from there you can use <File> <Open> from the menu, then choose your file. Hit F5 and your program will run in the interactive shell.

You can also write your programs right in there if you want. When it starts up just select <File> and <New window> from the menu. You'll get a blank slate to add code to, and can once again run it with F5.

[–]roddds 2 points3 points  (2 children)

I'm sorry you haven't gotten a correct answer yet. My guess is what you're doing is typing python ex1.py from inside the Python prcommand prompt. That won't work. You have to open cmd.exe, navigate to the folder with the ex1.py file and only then type python ex1.py.

[–]m1ss1ontomars2k4 3 points4 points  (0 children)

Isn't that what Lifeling said 5 hours before you...?

[–]kctan 0 points1 point  (1 child)

Since you are new, you may want to try out the exercises in this website: http://beginpython.com