954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Running files with command lines

Hi there, i'm learning python by reading a book and i am stuck in one of its examples:

i created succesfully a file with a basic script in it (i run it with the GUI) and it works fine, the file is named script1.py and i saved it in C:\Users\username\doocuments\varios 2\python journey\

the book says this:

Once you’ve saved this text file, you can ask Python to run it by listing its full filename
as the first argument to a python command, typed at the system shell prompt:
% python script1.py

Remember to replace “python” with a full directory path, as before, if your
PATH setting is not configured.

Sooo, my question is what is the full directory path that one must enter? in order to make it work?

Pybegginer
Newbie Poster
1 post since Feb 2012
Reputation Points: 10
Solved Threads: 0
 

If PATH environment variable include your Python install directory,you can run:
cd C:\Users\username\doocuments\"varios 2"\"python journey"
python script1.py

or like this:

c:\python26\python script1.py


In dos command window run "set PATH",can show PATH variable.

askandstudy
Newbie Poster
7 posts since Nov 2011
Reputation Points: 20
Solved Threads: 4
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: