PDA

View Full Version : Python


Markpyro
01-29-2005, 10:12 AM
I quote:



Setting the path

You will need to cause the directory containing the file named python.exe to be listed in your system environment variable named path.

But, I dont think I know how to set a path... Or I might know how but I dont know that I do... O.o

Can someone help me?

TimP
01-29-2005, 12:46 PM
Right click My Computer, click Properties, then click Advanced. At the bottom, click the Environment Variables button. The System Variables should be at the bottom. Scroll down until you find Path, then click edit, add a semicolon ( ; ) after the last entry if there isn't one already, and add the directory containing python.exe, but do not include the exe in the path.

Markpyro
01-31-2005, 9:51 PM
Thanks.
Next question-
I quote
A command prompt window

Then open a command prompt window and make the directory containing your new script file become the current directory
How do I make my script file the current directory?
I am using Windows XP Pro

Modred
01-31-2005, 10:44 PM
type cd c:\path to your directory...\ (assuming you use MS-DOS command prompts).

Example:
cd c:\docume~1\owner\mydocu~1\python\
(in Windows speak, that would be C:\Documents & Settings\Owner\My Documents\Python\)

Just change the path to the directory to whatever your script files are located in.

It was simply telling you to change directory from where your command prompt opens to where your script file is located.

Since you have set up the path to python.exe, you should be able to execute it from any directory now (thus it shouldn't be required to be in the same directory as your script).

TimP
01-31-2005, 10:54 PM
Abbreviated names are no longer needed in XP.

cd c:\documents and settings would work fine.

However, if you're passing it in as an argument for a program and it contains spaces, use quotes. For example:

python "c:\documents and settings\tim\desktop\helloworld.py"

xodkrm
02-01-2005, 10:39 PM
wuts python?

TimP
02-01-2005, 11:44 PM
A computer programming language.

http://www.python.org
http://en.wikipedia.org/wiki/Python_programming_language