Posts: 4,653
Threads: 1,496
Joined: Sep 2016
i don't know how to change the title of this thread.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,653
Threads: 1,496
Joined: Sep 2016
i need to do this in a way that can be done without any change to the calling file(s) (not mine) and without any disk I/O. the only idea i can up with real quick is to set/get environment variables. i coded the caller that does the testing, but in the real case this is code coming in from elsewhere as a bunch of .pyo files that has a simplistic config that lists what module.function to be called for specific hooks. it extracts the module name to know what to import (i presume). changing PYTHONPATH before this thing runs is an option but i doubt if that can help.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,653
Threads: 1,496
Joined: Sep 2016
there is a program (in a .pyo file) that can be configured to call specific functions of specific modules at specific hooks (by name) in the program. a particular hook defines the conditions of being called and what it expects to be returned. for some hooks i have many modules to choose from. for other hooks not so many or maybe just one. i want to let the user copy or link the module they want at certain places. i need to have a common data area that is shared by all the modules. some set or change the values. most read most values. one of the values is a large event list that gets appended to by many of the modules, what is needed is a way for every function (or class) in every module to access the common name space. i was expecting the global name space to be it. i thought of using the environment variable space but it is rather limited. so what if i make a module that all the others import define a class in it. can i then use this as a common reference space and write code in the many modules like:
common.foo = 42
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.