Archaeopteryx Software, Inc.
Take Flight!Search

Wing IDE
About Us
Open Source

 Advanced Search

[wingide-users] Reloading Python Modules

Gary Schiltz
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
  import child
  for i in range(1,10):
O     x = child.doSomething(i) # The "O" represents a breakpoint
      print x
  # End of

  # Start of
  def doSomething(i):
      return i + 1
  # End of

Say I put a breakpoint where the "O" is, start debugging, 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.

Run by Mailman v 2.0.8

Copyright (c) 2000-2002, Archaeopteryx Software, Inc.
Legal Statements