Hopefully this will be an easy question for some of you. So I am working on some code to interface with a heater controller. The GUI is written mostly in Kivy language (to compartmentalize the various screens), but I have a .py file that ties all the Kivy files together. Within one my Kivy files, there are a few TextInput fields that are for a user to define a few numerical values. Once the text fields are filled, the user clicks on the "Start" button to begin the heater test. Now, my question is when using the "Start" button as my flag, how can I get Python to read the numerical values that are in the fields? I've looked online and posts about using the .get and raw_input methods, but nothing that has Python retrieving and interpreting values from Kivy code. Any help would be much appreciated!
This is part pf my .py file, which where I need the user-input values to be evaluated...
class ControllerScreen(Screen):
def build(self):
return ControllerScreen()
def CreateExcelFile(self):
wb = Workbook()
ws = wb.active
ws.cell('A1').value = 'Timestamp'
ws.cell('B1').value = 'Temperature'
ws.cell('C1').value = 'Batch 1'
ws.cell(row=2, column=1).value = 000
wb.save("Spreadsheet1.xlsx")
This is an excerpt from the Kivy file, containing the code for a single text field that a user types a number into...
<ControllerScreen>:
TextInput: #Ramp time increment field
id: ramp_time
font_size: 25
size_hint: 0.1,0.06
pos_hint: {"right":0.575, 'y':0.67}
Button: #Start analysis button
on_release: app.root.current = "home"
text: "Start"
font_size: 25
color: 0,1,0.5,1
size_hint: 0.29,0.075
pos_hint: {'x':0.35, 'y':0.1}
And lastly, here is a picture of the GUI to give some reference to the text fields I am regarding (the one circled in red is the one I reference in the code above)...