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
845 M2 Mac fails to install rbenv install 3.1.3 due to errors
796 GDB gets version error when attempting to debug with the Presense SDK (IDE)
915 Uncaught (inpromise) Error on Electron: An object could not be cloned
1338 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2025 OneMinuteCode. All rights reserved.