Can’t figure this out. In Terminal, I import a module which instantiates a class, which I haven’t figured out how to access. Of course, I can always instantiate in Terminal:
Server=Data.ServerData()
Then I can get a result:
Server.Property().DefaultChart
However, I want to skip that step getting the result directly from the instance already running in the module. I think Data.Server in this case should load the Server instance from when I imported Data:
Data.Server.Property().DefaultChart >>> AttributeError: 'module' object has no attribute 'Server'
So how to access the running instance from Terminal?
If importing
Data.pyimplicitly creates an instance of theData.ServerDataclass (somewhat dubious, but OK in certain cases), that still tells us nothing about how that module chose to name that one instance. Dodir(Data)at the>>>prompt to see all the names defined in theDatamodule; if you want to see what names (if any!) have values that are instances ofData.ServerData, e.g.:Reading
Data.py‘s source code might be simpler, but you do have many other options for such introspection to find out exactly what’s going on (and how it differ from what you EXPECTED [[not sure on what basis!]] to be going on).