[IPython-user] Can "import" module, then "run" cannot find it
Mon Feb 22 20:34:58 CST 2010
You can use run - just specify the path to the module.
On Mon, Feb 22, 2010 at 1:13 AM, Thomas Baker <email@example.com> wrote:
> Hi Jörgen,
> > The reason for your confusion is that sys.path is the path used for the
> > python import mechanism but the run magic of ipython only looks in the
> > current directory.
> Okay - that does explain it - thank you!
> So if I want to run code, within ipython, but from a directory
> other than the directory where the code is located, I cannot use
> %run. But I guess if I %edit the code, %edit will find it wherever
> it is in my path, and when I exit the editor, the code will be
> executed. Would that be any different than using %run to execute
> the code?
> Many thanks,
> Tom Baker
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-user