[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] giving smalltalk python import
From: |
Robert Collins |
Subject: |
Re: [Help-smalltalk] giving smalltalk python import |
Date: |
Thu, 09 Sep 2004 17:14:41 +1000 |
On Wed, 2004-09-08 at 08:26 -0600, Brian Brown wrote:
>
>
> ______________________________________________________________________
>
>
>
> Actually, there is a standard mechanism in Python to support this;
> from the manual:
>
> However, some programs or sites may find it convenient to allow users
> to have a standard customization file, which gets run when a program
> requests it. This module implements such a mechanism. A program that
> wishes to use the mechanism must execute the statement
>
>
> import user
>
>
> The user module looks for a file .pythonrc.py in the user's home
> directory and if it can be opened, executes it (using execfile() ) in
> its own (the module user's) global namespace. Errors during this phase
> are not caught; that's up to the program that imports the user module,
> if it wishes. The home directory is assumed to be named by the HOME
> environment variable; if this is not set, the current directory is
> used.
This is slightly different: its a hook into the user space, that is
*) optional per program
*) not a search patch.
So to do it for all programs, a user must do what I already suggested.
To change the searchpath, .pythonrc.py must do the same thing, but in
the python internals.
I wish there was a standard user-search path in python.. but AFIAK there
isn't, and import user isn't it.
Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
signature.asc
Description: This is a digitally signed message part
[Help-smalltalk] re: editors, Robert Collins, 2004/09/08
[Help-smalltalk] Re: /bin/sh execution of st scripts., Robert Collins, 2004/09/08
- [Help-smalltalk] Re: /bin/sh execution of st scripts., Paolo Bonzini, 2004/09/08
- [Help-smalltalk] Re: /bin/sh execution of st scripts., Robert Collins, 2004/09/08
- [Help-smalltalk] GNU arch, Paolo Bonzini, 2004/09/08
- [Help-smalltalk] Re: GNU arch, Robert Collins, 2004/09/08
- [Help-smalltalk] Re: GNU arch, Paolo Bonzini, 2004/09/08
- [Help-smalltalk] Re: GNU arch, Robert Collins, 2004/09/08
- [Help-smalltalk] Re: GNU arch, Paolo Bonzini, 2004/09/09