When I save my own functions in a .py file and call them from an external py file, I want to update my own functions frequently, but once I call them from an external py file, I can't update them no matter how many times I import them.
Please let me know how to do it.
For example, if a file containing a self-made function is set to y.py and a program to call を is set to ..py, I would like to change ..py if necessary while trying various things by running ..py.
anaconda ipython
Have you seen autoreload?
For example, if there is a script like this in the current directory, foo.py
def say():
print ("hello")
Enabling the autoreload
module from ipython:
In[1]:%load_ext autoreload
In[2]: %autoreload2
The first boot looks like this:
In[3]:from from from import say
In[4]: say()
hello
Rewrite foo.py
at this time:
def say():
print ("world")
This is what happens when you run say()
on ipython.
In[5]: say()
world
918 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
621 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.