From: Utkarsh U. <mus...@gm...> - 2007-08-02 03:48:05
|
Well, in Python, there is a brute-force way of reloading all modules, and that is clearing out sys.modules dictionary. I wonder if that works in Jython. PS: There is also a safe way of doing it, which reloads only the modules that your program loads .. saving the initial sys.modules before your program loads and resetting the sys.modules to it when you need to reload the modules. Do tell me if it works. ~musically_ut On 8/1/07, David Handy <Dav...@sa...> wrote: > > If you repeat the command: > > import program_foo > > nothing will happen. You have to do this: > > reload(program_foo) > > to re-import a module whose source file has changed. But this won't > re-load any other module that program_foo.py imported, so if those files > changed you still have a problem. > > Maybe your other idea of running a start.bat file from main.py is a bette= r > idea. > > David H > > -----Original Message----- > From: jyt...@li... [mailto: > jyt...@li...] On Behalf Of > wer...@gm... > Sent: Wednesday, August 01, 2007 11:03 AM > To: Utkarsh Upadhyay > Cc: jyt...@li... > Subject: Re: [Jython-users] How to run a .py file from Jython > > Thank you for your reply. > Sorry, I must give some more background information. Let's say main.py is > a basic editor; I edit program_foo.py in main.py and want to start it fro= m > main after editing. If I repeat the import statment after editing; will t= he > edited version be reimported and executed? > > > > > > > import program_foo.py > > > > should be able to do it. > > > > Thanks again > > Markus > -- > Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! > Ideal f=FCr Modem und ISDN: http://www.gmx.net/de/go/smartsurfer > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/_________= ______________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > --=20 Never trust a spiritual leader who cannot dance. ~Mr. Miyagi, The Next Karate Kid |