reload

How to survive revert_mainfile() in memory?

How to survive revert_mainfile() in memory? Question: I’m trying to reload the blend file inside the loop in my script. Modal operator doesn’t work, because after scene reload the operator’s instance dies. So, I create my own class, which has my loop in generator, which yields after calling revert_mainfile(), and returning control to it from …

Total answers: 1

Reload Variable Data from DB without restarting Django

Reload Variable Data from DB without restarting Django Question: I have a function in my Django Views.py and I use the data in another function but if a user changes True to False then I want to update it without having to restart Django. def update_list(): global processess processess = botactive.objects.filter(active=True).values_list(‘user’) update_list() I use processess …

Total answers: 1

Python3 – reload() can not be called on __import__ object?

Python3 – reload() can not be called on __import__ object? Question: Ok so for a number of reasons, I’ve been using s = __import__(‘parse’) for the longest time in Python2, now I sorta need to being my transitions to Python3 for certain projects (mainly due to SSL). But there’s no reload() equivilant in Python3 as …

Total answers: 1

gunicorn autoreload on source change

gunicorn autoreload on source change Question: Finally I migrated my development env from runserver to gunicorn/nginx. It’d be convenient to replicate the autoreload feature of runserver to gunicorn, so the server automatically restarts when source changes. Otherwise I have to restart the server manually with kill -HUP. Any way to avoid the manual restart? Asked …

Total answers: 4

How to reload a module's function in Python?

How to reload a module's function in Python? Question: Following up on this question regarding reloading a module, how do I reload a specific function from a changed module? pseudo-code: from foo import bar if foo.py has changed: reload bar Asked By: Jonathan Livni || Source Answers: You will have to use reload to reload …

Total answers: 8

python refresh/reload

python refresh/reload Question: This is a very basic question – but I haven’t been able to find an answer by searching online. I am using python to control ArcGIS, and I have a simple python script, that calls some pre-written code. However, when I make a change to the pre-written code, it does not appear …

Total answers: 7

How do I unload (reload) a Python module?

How do I unload (reload) a Python module? Question: I have a long-running Python server and would like to be able to upgrade a service without restarting the server. What’s the best way do do this? if foo.py has changed: unimport foo <– How do I do this? import foo myfoo = foo.Foo() Asked By: …

Total answers: 23