From: aa8vb at vislab.epa.gov (Randall Hopper)
Date: Sat, 17 Apr 1999 15:31:21 GMT
Subject: sys.path.insert - how to make it global?
In-Reply-To: <3718a8aa.4229211@news.omnilink.de>; from Stefan Franke on Sat, Apr 17, 1999 at 03:30:26PM +0000
References: <19990416172011.A1551755@vislab.epa.gov> <3718a8aa.4229211@news.omnilink.de>
Message-ID: <19990417113121.A1627033@vislab.epa.gov>
X-UID: 1472                                                  

Stefan Franke:
 |Randall Hopper:
 |>     If I want to augment my Python module search path inside a Python
 |>script (so that it affects itself and imported modules), what's the best
 |>way to do this?
 |
 |sys.path *is* already global, though only accessible via the
 |sys module's namespace. Just give it a try.

I'd already tried that.  It's effect doesn't appear to be global:

   # Augment search path to pull in our C library wrappers
   sys.path.insert( 0, '/home/mylogin/Wrappers' )

   import MapFile

This allows Python to find MapFile, but this doesn't allow MapFile to
import other modules in that same Wrappers directory.

Randall






