Advice for using emacs python-mode
Erno Kuusela
erno-news at erno.iki.fi
Thu Nov 21 12:25:09 EST 2002
In article <yu99el9g2eyf.fsf at europa.research.att.com>, Andrew Koenig
<ark at research.att.com> writes:
| problem: It appears that if I change code in foo.py, and type C-c C-c,
| that change is not necessarily reflected in the program's execution.
| I am guessing that under some circumstances, what is happening is that
| the code is not getting re-imported.
the import statement only goes out and loads the code the first time
it asked for a module, then it gets cached in sys.modules.
you can manually reload a module with the reload builtin function,
you might want to use that in your __main__ block.
reloading gets hairy fast in more complicated setups (see eg
<URL: http://pyunit.sourceforge.net/notes/reloading.html>), but should
work with no trouble for this case.
-- erno
More information about the Python-list
mailing list