I've made a GUI from tkinter and are then trying to pass values entered into Entry widgets when a button is pressed to a separate module which is carrying out calculations.
An extract of the separate module calling the input is below:
# Calculation Module
xf = Extract_Inputs(self,'xf')
The function this refers to in the GUI is:
# GUI Module
def Extract_Inputs(self,x):
xf_In = float(self.e_xf.get())
if x == 'xf':
x = xf_In/100
Where e_xf
refers to the Entry widget
This brings up the error: name 'self' is not defined
when xf = Extract_Inputs(self,'xf')
is used.
How do I go about getting round this without making the first part into a function which I pass self into?
The complete files can be found here: https://github.com/AyrtonB/McCabe-Thiele/tree/master/MT%20v1.2