Using global variables between files?
The problem is you defined myList from main.py, but subfile.py needs to use it. Here is a clean way to solve this problem: move all globals to a file, I call this file settings.py. This file is responsible for defining globals and initializing them: # settings.py def init(): global myList myList = [] Next, your … Read more