#i am trying to get value from a text box with get in a guizero but I can not do that #due to it being unsupported how can i take value from textbox

    def submit():
         conn =sqlite3.connect("patientH.db")
        
         c= conn.cursor()
        
         c.execute(" INSERT INTO Staff VALUES (staffId, dname, ward, position )",
         {'staffId':staffId.get(), 'dname':dname.get(), 'ward':ward.get(), 'position':position.get()
         })
    
         conn.commit()
         conn.close()
    
         staffId.clear()
         dname.clear()
         ward.clear()
         position.clear()

1

There are 1 best solutions below

0
On

To get the input value with guizero you use input_box_name.value

Basic example of getting the input value

from guizero import App, TextBox, PushButton

app = App()

def print_value():
    #prints input value to console
    print(input_box.value)

input_box = TextBox(app)

button = PushButton(app, text="Print value", command=print_value)


app.display()