| | |
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: 977
Reputation:
Solved Threads: 273
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 ansi anti apache application approximation array assignment backend beginner binary bluetooth builtin calculator character cmd converter countpasswordentry curved customdialog dan08 decimals dictionary dynamic edit exe file float format function gnu graphics heads homework http ideas inches input java leftmouse library line lines linux list lists loop module mouse movingimageswithpygame mysqlquery number numbers numeric output parsing path phonebook pointer prime programming progressbar push py2exe pygame python random recursion redirect remote reverse schedule scrolledtext session software sqlite statictext statistics string strings sudokusolver syntax terminal text thread threading time tlapse tuple twoup ubuntu unicode unit urllib urllib2 variable wordgame write wxpython xlib






