The following forum message was posted by scientificsteve at http://sourceforge.net/projects/pydev/forums/forum/293649/topic/4531661:
I'm developing a GUI application using wxPython. I'm quite happy with PyDev,
but the only thing that I couldn't figure out up to now is how to reload modules
that I have changed while my application is running in PyDev.
To explain it in detail:
- I start my wxPython application using CTRL+F11 from within PyDev.
- I have to perform some steps (e.g. database connection, loading of projects,
...) before I reach the point in the source that I'm currently working on (e.g.
the showing of an error dialog).
- Now, for example I change the label of the error dialog in the source code.
- To activate these changes I have to restart my entire application, which
means going through all the initialization steps. This is quite time-consuming
and after some time it really gets annoying.
It would be very helpful to have the possibility to run the reload(module) command
from somewhere in PyDev.
Maybe this feature is already implemented, but I couldn't find it.
Also I couldn't find how to open the python shell in which the program started
with CTRL+F11 is running in. Maybe this would be the place where to type the
Hopefully someone can help me with these questions.
The following forum message was posted by fabioz at http://sourceforge.net/projects/pydev/forums/forum/293649/topic/4531661:
PyDev actually had such a feature, but it was removed because Python itself
does not have a good reload solution (one example: when reloading a module which
has a method, it'd have to update any references to the old method to point
to the new method, or make the old method redirect to the new method, etc.),
so, it was removed until someone is able to make it work reliably... (the solutions
could potentially break applications).
So, while there's no totally reliable solution, you can try for yourself one
of the solutions below, which may work (or not) for your specific use-case (it
seems they already evolved a bit since the last time it was integrated in PyDev,
so, I may end up checking it again).:
p.s.: May be related or not, but usually working with unit-tests may ease getting
to the point you want... (the usual modus operandi for test driven development
would be: write a test, run it, see it fail and only then go on to fix it, in
which case, reload isn't really that important -- although I agree that sometimes,
changing the code you're debugging can give you good results regardless