Answer the question
In order to leave comments, you need to log in
How to correctly access an instance from third-party modules?
Good afternoon, the question may be stupid, but google does not work.
For example: if I create an instance of the class described in the bot.py module from the main page of the application (main.py) - at startup, how can I access the created instance from a third-party module?
As far as I understand, each call to a class from bot.py leads to the creation of a new "clean" instance, but you need to work with the fields of the one that was created from main.py.
Or is a variable assigned to an instance of the "through" class for all imported application modules and can be accessed from anywhere while the application is running?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question