Hi Carlos, 

1) autoreload also works if one use "run selection" for example. 

2) runfile takes care of this in Python consoles, but it does not seem to 
do it in IPython consoles. 

Ex: 
#file1.py
def greetings() :
    print 'hello'
#file2.py
from file1 import greetings
def hello_world():
    greetings()

In the current console
>> runfile(r'/home/sylvain/file2.py', wdir=r'/home/sylvain/')
>> hello_world()
hello

Then modify file1 to print 'hello world'
If the console is a Python console, we have the following behaviour:
>> runfile(r'/home/sylvain/file2.py', wdir=r'/home/sylvain/')
UMD has deleted: file1
>> hello_world()
hello world

If the console is an IPython console, we have the following behaviour:
>> runfile(r'/home/sylvain/file2.py', wdir=r'/home/sylvain/')
>> hello_world()
hello

Cheers, 
Sylvain

On Saturday, June 8, 2013 11:18:31 AM UTC-4, Carlos Córdoba wrote:
>
> Hi, 
>
> runfile takes care of this already, so what would be the advantage of 
> autoreload? Could you provide an example? 
>
> Cheers, 
> Carlos 
>
> El 05/06/13 16:41, Sylvain Corlay escribió: 
> > Hello, 
> > 
> > Don't you think that it could be worth having the ipython autoreload 
> > magic activated by default in ipython consoles? 
> > 
> > This would make the behaviour closer to matlab when making 
> > modifications in imported modules. An easy way to do so is to run the 
> > code 
> > 
> > %load_ext autoreload 
> > %autoreload 2 
> > 
> > when starting ipython console. 
> > 
> > We already have the "Run code" section in the preferences, to place 
> > "%load_ext autoreload, %autoreload 2", but it could as well be an 
> > additional radiobox in the spyder startup section. 
> > 
> > Best, 
> > Sylvain 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "spyder" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to [email protected] <javascript:>. 
> > To post to this group, send email to [email protected]<javascript:>. 
>
> > Visit this group at http://groups.google.com/group/spyderlib?hl=en. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to