Reputation: 153
I have created the class in separate code in Python (Spyder). Then I import the class into main code using:
from othercode import classxy
Then the .pyc file is created in pychache' folder. However when I change something in the class, save it and import it once again in main code, then the .pyc file is not updated and main code is still working with old version of class. I have to delete the .pyc file for class and turn off and turn on the Spyder which is kinda dumb. Is there something I'm missing? When I run the main code in Anaconda prompt, everything is working as it should, just Spyder is behaving strange.
Upvotes: 1
Views: 937
Reputation: 34156
(Spyder developer here) To have your code updated after every change to it, you need to run these commands before running your code in our IPython consoles (but only once):
In [1]: %load_ext autoreload
In [2]: %autoreload 2
Upvotes: 1