dragonstar57 Posted February 2, 2011 Author Posted February 2, 2011 Ah! That's your problem. Read this: http://docs.python.org/faq/windows#how-do-i-run-a-python-program-under-windows ok i found the command prompt and entered the command python.exe and the name of changed to comand prompt - python.exe so now what?
Cap'n Refsmmat Posted February 2, 2011 Posted February 2, 2011 Read the instructions? Specifically, the bit that looks like this: Let’s suppose you have a program called pytest.py in directory C:\Steve\Projects\Python. A session to run that program might look like this:
dragonstar57 Posted February 2, 2011 Author Posted February 2, 2011 (edited) Read the instructions? Specifically, the bit that looks like this: i don't understand much of what it says...so where does it say what I'm supposed to DO is it trying to say that i need a more complete file path or what? nowhere do I see a "click on this it will open the area where you type you're code" or a "remember to include this in your command" is there a cliff notes version of this? any difference between typing python.exe vs python? Edited February 2, 2011 by dragonstar57
Cap'n Refsmmat Posted February 2, 2011 Posted February 2, 2011 You're going to have to learn to read documentation if you want to be able to program. Short version: Figure out where you saved your program. Perhaps you saved it in C:\Users\dragonstar\program.py. Open up Command Prompt. Type cd C:\Users\dragonstar then dir You'll see a list of all files in that directory. Make sure your program is one of them. Now type python program.py and your program will run.
timo Posted February 2, 2011 Posted February 2, 2011 Perhaps you should try some of the Youtube tutorials on Python under Windows. They might show you where to click when.
dragonstar57 Posted February 2, 2011 Author Posted February 2, 2011 You're going to have to learn to read documentation if you want to be able to program. Short version: Figure out where you saved your program. Perhaps you saved it in C:\Users\dragonstar\program.py. Open up Command Prompt. Type cd C:\Users\dragonstar then dir You'll see a list of all files in that directory. Make sure your program is one of them. Now type python program.py and your program will run. C:\Python22 file "<stdin>", line 1 C:\Python22 ^
Cap'n Refsmmat Posted February 2, 2011 Posted February 2, 2011 Open Command Prompt. Not "Python (Command Line)". Command Prompt. Stop opening the Python interpreter directly, because that expects you to type in Python code directly.
dragonstar57 Posted February 2, 2011 Author Posted February 2, 2011 Open Command Prompt. Not "Python (Command Line)". Command Prompt. Stop opening the Python interpreter directly, because that expects you to type in Python code directly. yeah that was command prompt-python (what i got after i typed python into the command prompt window) was i not supposed to type python into command prompt"?
Cap'n Refsmmat Posted February 2, 2011 Posted February 2, 2011 No, you were not. You were supposed to follow the instructions exactly as I typed them.
dragonstar57 Posted February 2, 2011 Author Posted February 2, 2011 (edited) No, you were not. You were supposed to follow the instructions exactly as I typed them. note: myfirstprogram.py is saved on the desktop and on the C:(there are two copies) drive under the folder Python22 C:\python22 dir C:\Documents and settings/owner>cd C:\python22 dir the system cannot find the path specified. C:\documents and settings \owner> Edited February 2, 2011 by dragonstar57
Cap'n Refsmmat Posted February 2, 2011 Posted February 2, 2011 You're supposed to press Enter before dir; it goes on a separate line, because it is a separate command. First use "cd" to get to the folder, then use "dir" to list its contents, after you have entered the folder.
dragonstar57 Posted February 2, 2011 Author Posted February 2, 2011 (edited) You're supposed to press Enter before dir; it goes on a separate line, because it is a separate command. First use "cd" to get to the folder, then use "dir" to list its contents, after you have entered the folder. done its there now what? exec myfirstprogram.py? Edited February 2, 2011 by dragonstar57
Cap'n Refsmmat Posted February 2, 2011 Posted February 2, 2011 So it says: C:\python22> in the command prompt now? If so, type "dir" and hit enter. You'll see a list of files. Now type, without the quotes, "python nameOfYourFile.py", being sure to replace that with the name of your file. It should run.
dragonstar57 Posted February 2, 2011 Author Posted February 2, 2011 (edited) So it says: C:\python22> in the command prompt now? If so, type "dir" and hit enter. You'll see a list of files. Now type, without the quotes, "python nameOfYourFile.py", being sure to replace that with the name of your file. It should run. ok it worked thankyou if i were dealing with another folder would the file path just be longer ie if there was another folder in Python22 would it just be something like C:\Python22:/programs Edited February 2, 2011 by dragonstar57
Cap'n Refsmmat Posted February 3, 2011 Posted February 3, 2011 It would be C:\Python22\Programs. Or C:\Python22\Programs\bananas\raspberries\walrusdroppings\. Or whatever. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now