From: Jonathan B. <jbr...@ea...> - 2006-01-14 22:11:05
|
On Sat, 2006-01-14 at 14:25 -0500, Laney Mills wrote: > Thanks to several people who responded. From you responses, I can see > that I didn't do a very good job of framing my question. > > Here's the situation. > > This is windows xp with python 2.4 and visual python installed in > C:\python24. The python runs fine. To run any of the examply *.py > files that come with vpython, all I have to do is click file open and > find the example files located in a subdirectory of c:\python24. > > Now I have several previously written *.py files in a directory that is > located far from (many clicks away inside the python file open dialog > box) What I really want is to have it so that when I click file open, > I am already in that directory of mine (the one far removed from > C:\\python24. In microsoft word and microsoft excel, there is a dialog > box in which one can make exactly that setting. The default working directory for IDLE is set in the shortcut properties (I think). The shortcut shipped with VPython is set to the examples directory, but you should be able to change it to whatever you like. > Assuming I cannot do that setting in python, my next preference to have > is the one I was trying to describe earlier. I want to fix it so that > if I type myfile.py from the command line and that myfile.py is in my > remote directory, that the python will open my file withouth a thousand > clicks. I assumed from my reading that onee makes an entry to the > "pythonpath" variable exactly as one used to do under dos. From the dos > prompt, type "path" and the contents of the path variable are > displayed. PYTHONPATH (in all caps) is not related to Python files in exactly the same way as PATH is related to executable files. PYTHONPATH only affects module import statements, not the search path for Python scripts. In all cases, C:\Python24\python.exe only takes an argument to the file to be run itself; it does not search a list of directories to find the file. HTH, -Jonathan |