Pure python code how do I dynamic load a method from different modules(files)?
Hope I can express it clearly with my English, I have a pure python multithreaded socket server code, and each thread dealing with a connection.
The socket server code receive a string as filename,
Question: the filename received vary and we assume the file do exist, these files all have the same entrance magic_main method, the server code need to load the magic_main from filenameA or filenameB according the received filename, How can I achive this?
Thanks in advance!
|