I need to learn about the using variables on function in same class.
For example my class is like in below:
class MainWindow(QMainWindow):
def __init__(self,parent = None):
QMainWindow.__init__(self)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
def myFunc1(self):
self.myVariable = 5
def myFunc2(self):
print(self.myVariable) #gives me 5
When I defined to variable like self.myVariable in myFunc1 I get its value from myFunc2. So If I use the self.does that make it a global variable ?
If I use like local variable in function, should i use it without self ?