I’ve decided to make a simple Telegram Bot in order to learn a bit of Python.
I have a main.py that imports and executes another file
#!/usr/bin/env python
import butlerr
if __name__ == '__main__':
butlerr.main()
I run that file
> python src/main.py
But if I make a change in butlerr.py, that’s not reflected in the running app. I imagine I won’t see changes in a running app. It works if I stop the command and re-run it, obviously.
I figure that’s probably not the way to develop. Is there a more seamless way to make changes and see them immediately? I saw a blog post where they create like a web server, but I think that doesn’t work on my case.
I closed a question I previously made cause I thought it was a docker issue, but it was not.
>Solution :
What you are looking for is called hot-reloading.
every famous python framework has the hot-reloading option ( so you can turn it on and off )
first check if your package has this feature or not.
Then if it did not have hot-reloading option, you can run your python app using this package