Jump to content

python help?

Featured Replies

  • Author

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 by dragonstar57

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.

Perhaps you should try some of the Youtube tutorials on Python under Windows. They might show you where to click when.

  • Author

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

^

  • Author

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"?

  • Author

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 by dragonstar57

  • Author

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 by dragonstar57

  • Author

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 by dragonstar57

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.