How can some one dynamically add the new modules in python running program and modify the old global variables or class object variables of running program from new modules. If it possible can some explain with example.
Asked
Active
Viewed 64 times
0
-
http://stackoverflow.com/questions/301134/dynamic-module-import-in-python ? – danidee Jul 20 '16 at 13:36
-
If you mean a Plugin Framework, have a look into yapsy to get started. Here is a basic Example http://stackoverflow.com/questions/5333128/yapsy-minimal-example . You could adjust the programm to loop around the main function so the Plugins will be updated/collected. – PhilipB Jul 20 '16 at 13:37
-
Lets say i have one python file **print_x.py** which have one **variable x with value 10** it is printing this value after every 10 sec. I want to write another file from where i can access variable X of print_x.py and modify it; so once it modified the print_x.py will start printing new value. (print_x.py is running in production environment and we can not stop this program) – Rahul.Shikhare Jul 20 '16 at 14:26