How can I update a source file (with classes) in interactive python -


simple python question.

when in interactive mode, i'm test imported file, let's use:

from foo import foo 

but in same time edit code. how can update script once loaded interactive python? when try reimport it, nothing happens , i'm still on old files.

thanks help.

edit: ok, understand reload(modulename) works fine, but... if i'm trying reload class methods? it's written in documentation:

if module instantiates instances of class, reloading module defines class not affect method definitions of instances — continue use old class definition. same true derived classes.

but there's no word how update class methods. idea?

the answer's here how reload code of method of class object in python?

no more question works fine :)

did take @ question? reloading changed python file in emacs python shell

libraries in python path can updated reload(modulename).


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -