help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] giving smalltalk python import


From: Brian Brown
Subject: Re: [Help-smalltalk] giving smalltalk python import
Date: Wed, 8 Sep 2004 08:26:11 -0600


On Sep 7, 2004, at 7:44 PM, Robert Collins wrote:

, ~/smalltalk-packages

how is this in python?

missing: folk tend to do something like:
export PYTHONPATH=~/mypackages
in their .bashrc or .profile

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

<x-tad-smaller>
import user
</x-tad-smaller>
<x-tad-smaller>

</x-tad-smaller><x-tad-smaller> </x-tad-smaller>
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.

reply via email to

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