Just for my knowledge, how does python, especially wxpython reacts to multiple imports? If I import wx in multiple files, how does it handle that when called the main frame? Does it slows the speed or it firstly checks whether it is already been imported or not?
Just for my knowledge, how does python, especially wxpython reacts to multiple imports? If
Share
When Python imports a file, it keps track of it by storing it in
sys.modules. So whenever Python is importing a file it checks there first and, if it finds it there, returns that instead; if it is not there, it imports it, adds it tosys.modules, and then returns it.