[wingide-users] Reloading Python ModulesGary Schiltz email@example.com
Tue, 23 Oct 2001 10:38:08 -0600
Is it possible to reload a Python module from within Wing while an application is running? For example: # Start of parent.py import child for i in range(1,10): O x = child.doSomething(i) # The "O" represents a breakpoint print x # End of parent.py # Start of child.py def doSomething(i): return i + 1 # End of child.py Say I put a breakpoint where the "O" is, start debugging parent.py, step into child.doSomething(), and decide to change the logic of doSomething() to return i * 10. How do I get the module to be reloaded? Actually, I just now figured it out, but since I had already composed the question in this message, I might as well post it :-) I can go to the Expression Evaluator window and type reload(child) to get the behavior I want. So, I guess this just turned into a feature request: easier ways to reload modules. Some suggestions: 1. A right-button menu item on each item in the call stack for "Reload module of stack frame" 2. When saving a module in which the debugger is stopped, display a pop-up dialog asking whether the module should be reloaded. It probably isn't easy to decide in what context the reload should be performed, so maybe it's best the way it is. Wow, I just came up with a question, its answer, a feature request, and a reason why the feature request might not be a good idea, all in one message :-) By the way, I really like Wing so far (I've been using the evaluation license for a week or so). Keep up the good work! ---- Gary Schiltz Bioreason, Inc. www.bioreason.com
Run by Mailman v 2.0.8
Copyright (c) 2000-2002, Archaeopteryx Software, Inc.