[Pythonmac-SIG] Running Python scripts without full paths

Paul Berkowitz berkowit@silcom.com
Sat, 30 Nov 2002 11:52:53 -0800


On 11/30/02 11:33 AM, "Nicholas Riley" <njriley@uiuc.edu> wrote:

> If you want to see the starting environment of a process, try 'ps
> -eww'.  For example, here it is for the zsh process Terminal just
> started (to display that for the shell you're in now, try 'ps -Teww').
> 
> 14555 std  Rs     0:00.76 -zsh HOME=/Users/nicholas SHELL=/bin/zsh
> USER=nicholas PATH=/usr/bin:/bin:/usr/sbin:/sbin:/Users/nicholas RSYNC_RSH=ssh
> QDTEXT_ANTIALIASING=1 QDTEXT_MINSIZE=14
> OMNI_INSTALLED_PRODUCTS=/Users/nicholas/Library/Frameworks DISPLAY=localhost
> SSH_ASKPASS=/Applications/Utilities/SSHPassKey.app/Contents/MacOS/SSHPassKey
> CVS_RSH=ssh __CF_USER_TEXT_ENCODING=0x1F5:0:0 TERM=vt100 TERMCAP=M-??M-V
> TERM_PROGRAM=Apple_Terminal TERM_PROGRAM_VERSION=81     (zsh)
> 
> Note that this is not the -current- environment of the zsh process,
> which you can display with 'printenv'.  The ps process that produced
> the above, however, inherited the shell's current environment.  The
> zsh process received its initial environment from its parent process,
> Terminal (if you use login, then the shell's parent process will
> be login, and login's parent process will be Terminal).


What I get (before trying anything else) is:

[250-166:~] berkowit% ps -eww
  PID  TT  STAT      TIME COMMAND
  621  p1  S+     0:00.38 -tcsh HOME=/Users/berkowit SHELL=/bin/tcsh
USER=berkowit PATH=/usr/bin:/bin:/usr/sbin:/sbin:/Users/berkowit
PYTHONPATH=/Users/berkowit/Library/Scripts/Python: DISPLAY=:0.0
__CF_USER_TEXT_ENCODING=0x1F5:0:0 TERM=vt100 TERMCAP=M-??M-WM-@
TERM_PROGRAM=Apple_Terminal TERM_PROGRAM_VERSION=81 LOGNAME=berkowit
(tcsh)
  643 std  S      0:00.21 -tcsh HOME=/Users/berkowit SHELL=/bin/tcsh
USER=berkowit PATH=/usr/bin:/bin:/usr/sbin:/sbin:/Users/berkowit
PYTHONPATH=/Users/berkowit/Library/Scripts/Python: DISPLAY=:0.0
__CF_USER_TEXT_ENCODING=0x1F5:0:0 TERM=vt100 TERMCAP=M-??M-WM-@
TERM_PROGRAM=Apple_Terminal TERM_PROGRAM_VERSION=81 LOGNAME=berkowit
(tcsh)


Just the default PATH, not the Library/Scripts/Python folder I added.

It does look as if maybe I can add a new PATH key in
~/.MacOS/environment.plist to do what PYTHONPATH does now. Worth a try?

-- 
Paul Berkowitz