1 Dec 07:54
Re: reload question
belinda thom <bthom <at> cs.hmc.edu>
2006-12-01 06:54:07 GMT
2006-12-01 06:54:07 GMT
On Nov 28, 2006, at 10:34 PM, Fernando Perez wrote: > [snip] > Ideally, I'd open e.g., foo.py, into xemacs and then (re)load it into >> iPython (py-shell buffer) via C-c RET. When I do this, it does put >> foo into the interactive namespace. However, for doctesting, I want >> the objects inside of foo.py to be in the namespace. To accomplish >> this: >> >> from foo import * >> >> works. However, if I now modify foo.py in some way, I can't figure >> out how to reload the objects into the namespace directly. >> >> This kind of operation seems like it might be used a lot. Is there >> some magic command I'm missing? > > More like a python trick: > > import foo; reload(foo); from foo import * > > This will ensure that every time that line is run, you actually see > the changes in foo. Here's a related (?) question. I am editing a file in xemacs (call it foo.py). I then Ctrl+c Ctrl+m (py-execute-import-or-reload) and (all?) the changes are not visible in py-shell. To be concrete, suppose I just added a new method to class Foo in(Continue reading)
RSS Feed