In other Python IDEs (PythonWin and Idle) it's possible to hit a key and have your current source file window reloaded into the console. I find this useful when experimenting with a piece of code; you can call functions from the console interactively and inspect data structures there.
Is there a way to do this with Eclipse/Pydev?
So far I've been making do with this hack in my source file:
def relo():
execfile("/Path/To/Source.py", __builtins__)
I call relo()
in the console after I save changes to the source. But I'd much rather just tap a key. I'm using pydev 1.4.7.2843.
This is somewhat related to this question, but I want to just reload the whole source file.
You can do it with Ctrl+Alt+Enter on the latest Pydev for details on what Ctrl+Alt+Enter provides as it can do a number of things related to the interactive console.
Use the revert option on the File menu.
You can bind a key to it in Windows > Preferences > General > Keys.
Edit:
The reload(module) function will update packages in the interactive console. It's built in for python 2.x and in the imp module for 3.x. Python docs link: http://docs.python.org/3.1/library/imp.html?#imp.reload
Couldn't find a way to run it by hotkey, I'd like to know if you find a way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With