| | |
PATH not known in Windows?
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
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,071
Reputation:
Solved Threads: 299
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
Views: 2690 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for Python
accessdenied address ansi backend beginner changecolor class code conversion coordinates copy corners curves customdialog dan08 dictionary directory dynamic edit examples excel feet file float font format ftp function generator getvalue gui halp homework i/o iframe images import info input ip java line linux list lists loop mouse mysql newb number numbers output panel parsing path port prime print program programming projects py2exe pygame pyqt python queue random rational recursion recursive screensaverloopinactive scrolledtext server ssh stamp statictext string strings sudokusolver table terminal text thread threading time tkinter tlapse tuple tutorial type ubuntu unicode url urllib urllib2 variable whileloop windows write wxpython






