[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 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, 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.


GPG key available at: <>.

Attachment: signature.asc
Description: This is a digitally signed message part

reply via email to

[Prev in Thread] Current Thread [Next in Thread]