[Edu-sig] PEPTALK: path sanity and newbie mental health --
please help
Kirby Urner
urnerk@qwest.net
Mon, 07 Jul 2003 23:21:39 -0700
At 09:36 AM 7/7/2003 -0500, John Zelle wrote:
>Hello all,
>
>I've been only a lurker on this list, and I hate to prolong this thread,
>but there is one simple point that I don't think has been addressed yet.
>Generally, when working on Python programs, you'll want to start an
>interactive shell, editor, etc. in the directory where your current
>project resides.
I don't think that's so important, if the path is setup right. My "Start in:"
directory for a Python shell is always something like D:\PROGRA~1\Python22 i.e.
is the Python root directory. None of my own working files will be there.
They're in site packages, a subfolder thereof (packages) or maybe in
pythonroot\work.
I use the .pth approach i.e. when I boot Python, the contents of .pth files
extend the set of directories in which Python looks for modules (Arthur
suggested this as well).
Look at Python's own libraries -- they're not in the root that the shell,
by default, starts in.
>Under Windows, the easiest way to do this is to place a shortcut for
>Python, IDLE or whatever in the directory where you are working. Just make
>sure that the "Start in:" entry of the shortcut is blank, and the program
>will fire up using the directory it's currently in as the default working
>directory. Since Python will load modules from the current directory, this
>is a quick and easy way to work on your programs without doing any path
>futzing at all.
But I don't want to create different icons for each subdirectory I might be
working in.
>In Jason's case, a shorcut on his firewire drive should solve the problem
>described below. Of course, you need to make sure to start Python or IDLE
>from the shortcut on the drive, not from the Start menu.
>
>Cheers,
>
>--John
Or he might create a .pth file containing the line m:\pystuff (or whatever).
To me that seems the easiest solution.
Kirby