When is a module imported from the standard library?
bh at intevation.de
Wed Aug 22 21:39:31 CEST 2001
Jeff Shannon <jeff at ccvcorp.com> writes:
> Ignacio Vazquez-Abrams wrote:
> > #! /usr/bin/python
> > import os
> > import string
> > print os.path.dirname(string.split(`os`, "'"))
> > ---
> > I tested it under 1.5.2. Does it also work under 2.x?
> It seems to (though I used `os`.split() instead of importing
> string)--I'm using 2.0
> However, I would be worried about this being somewhat fragile, as it's
> depending on the specific format of a module's repr()--it seems to be
> constant across versions, but I'd hate to presume that it will stay so.
Well, why not simply
Intevation GmbH http://intevation.de/
More information about the Python-list