Do I have to quit python to load a module?

W

wang frank

Hi,

When I edit a module, I have to quit python and then restart python and
then import the module. Are there any way to avoid quit python to load an
updated module? When I am debugging a module code, I need to constantly
make changes. It is not convenient to quit and reload.

Thanks

Frank

_________________________________________________________________
$B%a%C%;%s%8%c!<$*M'C#>R2p%W%l%<%s%HBh(B2$BCF3+;O!*%i%9%Y%,%9N99T%W%l%<%s%H(B
http://campaign.live.jp/dizon/
 
P

Peter Otten

wang said:
When I edit a module, I have to quit python and then restart python and
then import the module. Are there any way to avoid quit python to load an
updated module? When I am debugging a module code, I need to constantly
make changes. It is not convenient to quit and reload.

There is the reload() function, but it has pitfalls. Objects referenced from
without the module are not updated:
.... def f(): print "version one"
.... """).... def f(): print "version two"
.... """)version one

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,265
Latest member
TodLarocca

Latest Threads

Top