Using Namespace for Global Variables in Python

preview_player
Показать описание
I need to make a value into one of those frowned-upon global variables. Even though it's not good practice, Python provides a fairly clean way to do it through namespaces.
Рекомендации по теме
Комментарии
Автор

Thanks for the video..
Wondering if I have a PyQT4 GUI defined in one file, and I have some objects instantiated in the main.py.... how do I call the methods in my object defined in main, from the methods of the click button defined in the file that has the GUI object defined..

You seem to know alot about python, and I'm a beginner..  Wondering if you could help?

FILE1:
class
    def want_to_run_this_Method:
         return stuff
A = obs_table
B=obs_table

FILE 2:
class guiwindow:
...
...
    QtCore.QObject.connect(self.pushButton_8, , ,,, A.want_to_run_this_Method() )

Oogobuk
visit shbcf.ru