0

I have a python function

def My_Function():
    Some Codes
    return Something

I want to change Some Codes in My_Function as see the effects in Ipython console. So I modify Some Codes and save the corresponding .py file and import the function in Ipython console: import My_Function. However, when I execute My_Function in Ipython, the old version is executed not the modified one. Why?

Admia
  • 919
  • 3
  • 9
  • 23
  • A better `reload` SO question for `ipython` is: http://stackoverflow.com/questions/5364050/reloading-submodules-in-ipython – hpaulj Jul 18 '16 at 16:48

1 Answers1

1

Use importlib.reload(module).

user94559
  • 57,357
  • 6
  • 98
  • 99