For example if I want to run python.exe without being inside the python folder, how can I do this?

I'm here --> C:\

I want to call --> C:\Python27\python

Without having to cd Python27

link|improve this question
feedback

migrated from stackoverflow.com Jun 27 '11 at 9:03

This question came from our site for professional and enthusiast programmers.

3 Answers

That would be the following command:

C:\Python27\python
link|improve this answer
1  
lol thanks. I didn't know you needed to call the full path – Takkun Jun 26 '11 at 20:24
And as Random mentions below, you don't need the `c:\` part since that's your current directory, so it doesn't need to be an absolute path. – JdeBP Jun 27 '11 at 10:02
@JdeBP: Oh, I missed that. Well, at least this will work anywhere! – minitech Jun 27 '11 at 15:43
Indeed, it has that advantage. What M. Takkun needs to know is that %PATH% searching occurs when the name has no path prefix (no drive nor directory) at all. Otherwise the name is taken to be a relative or absolute pathname and is used as-is. – JdeBP Jun 28 '11 at 9:30
feedback

Python27\python.exe That should do it.

link|improve this answer
feedback

You can also add the exe to the system path variable, which will make it available from anywhere in your system.

Go to System->Environment Variables->Path (or something similar) and append the path to the end of the list.

May require a restart.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown