On Nov 5, 7:36 pm, Kurda Yon <[EMAIL PROTECTED]> wrote: > Hi, > > I have the following small problem. I run Python interactively. In the > beginning of the run I import many functions from many modules. Than I > execute some commands and notice that one of the imported functions > contains a mistake. I open another terminal in which I open the file > with the problematic function and correct the function. However, the > Python does not see my changes. It still uses the old version of the > function. In principle I could close the Python session and reopen it > again and import all functions agane. But it does not seem to be a > convenient solution. Is there a way to force Python to re-import the > function, i.e. to force it to use the new version of the function? > > Thank you in advance.
Here is another option. Look at the InteractiveConsole class. When you make a change, run the command: >>> changed Your subclass of InteractiveConsole catches it and does not send it to the compiler. Instead, it closes and reruns the entire session so far. Or, just the imports and definitions, which you have to detect by hand. This is probably the hard way. -- http://mail.python.org/mailman/listinfo/python-list