![]() |
| ||
| PATH not known in Windows? 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 |
| ||
| Re: PATH not known in Windows? Write a small Python program like the one below and save it as PrintHello.py ... print "Hello"Now run this program ... import subprocessIt seems to find Python.exe without any problems. |
| ||
| Re: PATH not known in Windows? 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. import sys |
| ||
| Re: PATH not known in Windows? Quote:
This person wants to use Window's Environment Variable. |
| ||
| Re: PATH not known in Windows? Thanks to you all for your quick answer! The method with subprocess.call is exactly what I want and runs perfectly. Bye, Dams |
| All times are GMT -4. The time now is 4:18 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC