[IPython-user] Search path used by run magic command

John VanLaanen johnvanlaanen@yahoo....
Thu Mar 29 14:50:45 CDT 2007


On 3/28/07, Tony Mannucci <Tony.Mannucci@jpl.nasa.gov> wrote:
> When I execute the run magic command, I cannot tell what search path
> is being used. Is it possible to use associate a search path to
> "run"? In the version I am running (0.7.2) run does not search
> sys.path.
>
> Thanks for your help!

I'm a long-term Matlab user relatively new to Python and IPython (and LOVING it!), and I was disappointed with the run command not using the same search path as imports. So I copied and modified the run magic command and saved it as my own "rrun" magic command. I replaced the call to get_py_filename with my a search of the current directory and then in sys.path. Ultimately I'd rather get_py_filename did it the way I wanted, so everything that uses it could benefit - but I couldn't figure out how to do that without modifying the distributed code.
 
Not sure what the protocol is for sharing code through this email chain, but I'd be glad to provide the simple code mod I did to anyone interested.
 
I suspect the fact that the run command doesn't do what I wanted has a somewhat philosophical source, but if possible I'd sure love it if this change got incorporated into IPython - I don't see any negative side effect.
 
- jvl


 
____________________________________________________________________________________
We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ipython.scipy.org/pipermail/ipython-user/attachments/20070329/bc77316a/attachment.html 


More information about the IPython-user mailing list