The example shows:
I create a simple module (fibonacci calculator)
I start a pycharm console, import the module, run the function inside console, and it works.
Now I edit some print text in the module.
Go back to the console and run "import fibagain"
The console seems to do this without complaining.
But when I run the fib() function, it is still giving me results from the earlier version. I cannot make the console see the updated version of the fibagain.py file.
If I delete the console and open it again, then 'import fibagain', running fib(3) will give me the latest version.
sorry, but not permitted to post proper image links here. This address shows the screencapture:
Instead of import
again, you want:
reload(fibagain)
This will reload the updated module. (Note: This only works if fibagain
had been imported some time earlier)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With