Terry Reedy wrote:
Jean-Michel Pichavant wrote:
Piet van Oostrum wrote:
[snip]
JP> file = "/home/dsp/4.6.0.0/test.py"
JP> test = __import__(file)
JP> => no module name blalalal found.
JP> Any suggestion ? I tried multiple escape technics without any
success.
Rightly so.
I think the be
Jean-Michel Pichavant wrote:
Piet van Oostrum wrote:
[snip]
JP> file = "/home/dsp/4.6.0.0/test.py"
JP> test = __import__(file)
JP> => no module name blalalal found.
JP> Any suggestion ? I tried multiple escape technics without any
success.
Rightly so.
I think the best would
Piet van Oostrum wrote:
[snip]
JP> file = "/home/dsp/4.6.0.0/test.py"
JP> test = __import__(file)
JP> => no module name blalalal found.
JP> Any suggestion ? I tried multiple escape technics without any success.
Rightly so.
I think the best would be to add the directory to sy
Chris Rebert wrote:
> You want the imp.load_module() function:
> http://docs.python.org/library/imp.html#imp.load_module
>
> __import__() only operates on module/package names. I'm not sure how
> you even got it to work with a filename...
It used to work with filenames but it was a bug. I guess s
> Jean-Michel Pichavant (JP) wrote:
>JP> Hi fellows,
>JP> I'd like to use the dynamic __import__ statement. It works pretty well with
>JP> non dotted names, but I cannot figure how to make it work with dotted file
>JP> paths.
What is a dotted file path? Is that 4.6.0.0?
>JP> example:
>JP>
On Tue, Jul 21, 2009 at 2:42 PM, Jean-Michel
Pichavant wrote:
> Hi fellows,
>
> I'd like to use the dynamic __import__ statement. It works pretty well with
> non dotted names, but I cannot figure how to make it work with dotted file
> paths.
>
> example:
>
> file = "/home/dsp/test.py"
> test = __im
Hi fellows,
I'd like to use the dynamic __import__ statement. It works pretty well
with non dotted names, but I cannot figure how to make it work with
dotted file paths.
example:
file = "/home/dsp/test.py"
test = __import__(file)
works like a charm
file = "/home/dsp/4.6.0.0/test.py"
test =