Is there a way to associate a console to a module, so that variables defined in the module can be accessed and used interactively? I know in other IDEs (PyScripter) your variables are saved and you can access, plot, re-define, etc.
I'm new to Python, trying to break from Matlab. Any help, would be greatly appreciated.
You can start the interactive console and do a from my.module import * to have the tokens available ( http://pydev.sourceforge.net/console.html ).
In pydev extensions you can use ctrl+alt+enter to do it easier... (see http://fabioz.com/pydev/manual_adv_interactive_console.html )
Thanks for getting back to me. That works in terms of accessing the variables, but I noticed another bug. If I have a
plot command in the module, it will run the script including the plot, but Eclipse will freeze until I close the figure. Is there anyway around that?
Also, are there any 'delete' or 'clear' commands to erase some/all variables while working interactively?
Well, actually, there's no way around it... When you issue a command to python, the shell will only respond when an answer is gotten (so, if you open a modal dialog, it'll only respond when it finishes -- just like you'd expect from any other shell). You could work around that in your own code (not sure which API you're using, but if you don't open it as modal, it should work).
To remove a variable from the namespace, you can do: 'del varName'. To erase all you could do: locals().clear().
In the MacPython IDLE there is always an active shell, so when you run a program you can always access the variables after it is finished running. I have used the eclipsed-based workspace for IDL and it also includes a command line where you can access variables after a run.
Is there anyway to have a permanent active shell with pydev?
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.