Windows doesn't have a HOME environment variable, but it does have
HOMEDRIVE and HOMEPATH. Could Windows versions of Python automatically
populate os.environ with HOME, where HOME =
os.path.join(os.environ['HOMEDRIVE'], os.environ['HOMEPATH'])?
If this was done, then modules such as pdb, which loa
I just figured out a reasonably decent way to use pdb in SciTE for
debugging Python scripts. Debugging takes place in the SciTE output
window. I have only tested this with SciTE on Windows.
Here are the pieces you need:
1. Create a debug.py script file (I save this in
c:\usr\python\scripts):
impo
Cool, even better. So what's best, having code to add HOME
(=USERPROFILE) to os.environ, or change the various places that HOME is
used to check for USERPROFILE?
--
http://mail.python.org/mailman/listinfo/python-list
Based on information from Jarek Zgoda in another thread on the Windows
USERPROFILE environment variable, debug.py should be:
import sys
from pdb import pm, set_trace
from inspect import getmembers
if sys.platform == 'win32':
import os
os.environ['HOME'] = os.environ['USERPROFILE']
del sys.
Having a function is definitely cleaner. Creating a HOME environment
variable where one does not exist in the calling shell is misleading.
There are 10 modules in the python 2.3 lib directory that contain
os.environ['HOME']:
lib\ftplib.py
lib\mailbox.py
lib\mailcap.py
lib\netrc.py
lib\ntpath.py
l
Does Windows 98 have a %USERPROFILE% environment variable?
--
http://mail.python.org/mailman/listinfo/python-list
os.path.expanduser('~') is a bit cryptic for non-unix people.
os.path.gethome() or something like that would be nicer. expanduser()
should then call gethome() so the logic is in one place.
It looks like the existing logic in expanduser() is out of date anyway.
It should be updated to use %USERPROF