| | |
PATH not known in Windows?
Thread Solved |
•
•
Join Date: Jan 2007
Posts: 2
Reputation:
Solved Threads: 0
Hello,
I am new to Python and find it really nice.
But I can not launch an executable file using only its name. I have to give its whole path. I expected that the PATH environment variable is known by Python and that it could retrieve the full path itself...
I use Windows XP, Python 2.5 and os.spawnl to launch the executable file.
Thanks in advance for your help!
dams
I am new to Python and find it really nice.
But I can not launch an executable file using only its name. I have to give its whole path. I expected that the PATH environment variable is known by Python and that it could retrieve the full path itself...
I use Windows XP, Python 2.5 and os.spawnl to launch the executable file.
Thanks in advance for your help!
dams
Write a small Python program like the one below and save it as PrintHello.py ...
Now run this program ...
It seems to find Python.exe without any problems.
Python Syntax (Toggle Plain Text)
print "Hello" raw_input("Press Enter to go on ... ")
Python Syntax (Toggle Plain Text)
import subprocess subprocess.call(["Python.exe", "PrintHello.py"])
May 'the Google' be with you!
•
•
Join Date: Dec 2006
Posts: 1,008
Reputation:
Solved Threads: 285
This will print your PYTHONPATH. If the path you want is not listed, and it shouldn't be because your program isn't found, then you have to use sys.path.append to add it.
Python Syntax (Toggle Plain Text)
import sys path_list= sys.path for eachPath in path_list : print eachPath
•
•
•
•
This will print your PYTHONPATH. If the path you want is not listed, and it shouldn't be because your program isn't found, then you have to use sys.path.append to add it.Python Syntax (Toggle Plain Text)
import sys path_list= sys.path for eachPath in path_list : print eachPath
This person wants to use Window's Environment Variable.
![]() |
Similar Threads
- quick launch disappears each reboot (xp) (Windows NT / 2000 / XP)
- help me set path (Java)
- One-Click Restart Windows! (Windows tips 'n' tweaks)
- Python path HELP (Python)
- Cannot delete file (Windows 95 / 98 / Me)
- Simulating on screen keyboard - Windows application in C# (C#)
- "MiCr0s0ft.exe", "Microsoftx.exe" & "ns.exe" viruses?Please Help (Viruses, Spyware and other Nasties)
- Can't remove "about:blank" homepage. Please help. (Viruses, Spyware and other Nasties)
Other Threads in the Python Forum
- Previous Thread: Game Logic: Determining Aces
- Next Thread: Use Python module tarfile to compress files
| Thread Tools | Search this Thread |
abrupt accessdenied anti apache application approximation argv array beginner book builtin calculator change converter countpasswordentry curved dan08 dictionaries dictionary dynamic edit enter examples file float format function gui heads homework import inches input java keyboard lapse launcher library line lines linux list lists loop microphone mouse movingimageswithpygame mysqlquery newb number numbers numeric output parameters parsing path phonebook plugin port prime programming projects py2exe pygame pyopengl python random recursion redirect remote reverse scrolledtext session simple software sprite statictext statistics string strings syntax table terminal text textarea threading time tlapse trick tuple tutorial twoup ubuntu unicode unit urllib urllib2 variable wordgame wxpython






