From: Laney M. <mi...@co...> - 2006-01-14 19:26:21
|
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. 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. Any modifications are made by adding onto the path statement in the autoexec.bat file. Now in windows xp. I can't even find the autoexec.bat statement (which actually is a dos thing). I can't find any windows equivalent of autoexec.bat or of the path statement itself. The python books and the online docs make reference to a "pythonpath" statement. It is that statement I'm trying to find. If in python idle, I clice file path browser, I get a dialog box that makes a list with about 6-8 lines with each line clearly describing a search path. I am assuming that it I need to add my distant directory to that list. Only I can't figure out from the documentat where that list resides, where is comes from, or how to add to it. I know I am missing some major obvious point that is so fundamental that it is hard to address, but still I am in the situation of having to go though about 8 clicks *every* time I want to open a file in my own directory where my *.py files are located. Thanks to every and sorry about not giving enough information to make my question clear. Laney Mills -- Laney Mills, Professor of Physics College of Charleston s: 843 953 8072 h: 843 762 2394 fax: 843 953 4824 |
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 |
From: Jonathan B. <jbr...@ea...> - 2006-01-14 23:21:20
|
On Sat, 2006-01-14 at 17:58 -0500, Laney Mills wrote: > got it, and thanks. > > One more question. Is TKinter an add-on to Python and what are the > situations in which one would need to learn about it. It is built as an extension module and shipped with a default Python install. You might use it to build multiplatform GUI programs with tcl/tk. However, based on the atrocious look of Tcl/Tk on my Linux machine, I would personally develop using PyGTK or WxPython. -Jonathan |