python_avatars
python_avatars copied to clipboard
library doesn't update while the script is running
well, for script.1.py having this updating code which is running 24/7. and let's say script.2.py which is not running. when script1 update the library for 1 time and resting, if i run script2 to check if the library is updated, yes it is updated after the delay script1 will check if the library is updated, no it is not. script2 can access the updated library while the script1 is constantly using previous library. if i stop script1, and run script1 again, it will use the updated library script1:
import python_avatars as pa
from importlib import reload
from time import sleep
while True:
pa.install_part("suit.svg", pa.ClothingType)
sleep(10)
reload(pa)
pa.uninstall_part(pa.ClothingType.SUIT)
script2:
try:
getattr(pa.ClothignType, "SUIT")
print("found")
except:
print("doesn't exist")
This seems a somewhat complex task. As I said in #4, I will try to fix it when I can. Any contributions are welcome too