do-not-spam-ben.hutchings at businesswebsoftware.com
Tue Mar 18 18:16:22 CET 2003
In article <cf097vcss862rmi5n83gc0rp2dt1mhiea7 at 4ax.com>, Rene Pijlman wrote:
> Ian Bicking:
>>> how can i force a script to execute in the user's home directory?
>>If you want to go to a home directory of a user that's not the current
>>user, you can use the pwd module, like
Or, perhaps more readably:
> I think this is a better solution than os.environ['HOME'], even
> for the current user, since HOME is set to the user's home
> directory only by convention. It may be (re)set to anything in
> the execution environment of the script.
If the user shouldn't be allowed to change their home directory by
setting HOME, consider what they can do by setting PYTHONPATH...
More information about the Python-list