python interpreter

Wojtek Walczak gminick at nie.ma.takiego.adresu.w.sieci.pl
Tue Aug 12 17:06:44 CEST 2008


Dnia Tue, 12 Aug 2008 07:58:52 -0700 (PDT), s0suk3 at gmail.com napisa³(a):
>> I'm using python's interpreter's to run various commands (like a
>> normal shell). However if sources are modified changes are not
>> reflected so I have to restart interpreter. Is there any way to avoid
>> restarting this?
>>
>> example:
>>
>> import blah
>>
>> blah.Blah()
>> # ... blah.Blah() changed
>>
>> blah.Blah()
>> # ... new behavior
>
> blah = reload(blah)

...but don't forget to read point 7.5 of the Programming FAQ:
http://www.python.org/doc/faq/programming/

And keep in mind that reload() is removed in Py3k. Hope this helps.

-- 
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/



More information about the Python-list mailing list