Jump to content

Wadikjunge

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Wadikjunge

  • Rank
    Newbie
  1. Hey, i have some problems with my tkinter formular maybe someone can help me with that. from tkinter import * import mysql.connector providerlist = ["FIVE","BLAU","KLAR","BASE"] mydb = mysql.connector.connect( host="localhost", user="root", passwd="", database="db", ) #print(mydb) def load(): print(provider) mycursor = mydb.cursor() sql = "INSERT INTO tbl_prepaid(handynummer, provider, euro) VALUES ( "' + str(handynummer.get()) + '","' + providerlist[provider.get()] + '", "' + str(euro.get()) + '" ) " print(sql) mycursor.execute(sql) mydb.commit() root = Tk() Label(root, text="Nummer").grid(row=0) Label(root, text="Wiederholen").grid(row=1) e1 = Entry(root) e2 = Entry(root) e1.grid(row=0, column=1) e2.grid(row=1, column=1) v = IntVar() w = IntVar() Label(root, text="""Wählen sie einen Provider:""", justify = LEFT, padx = 20).grid(row=2) Radiobutton(root, text="FIVE", variable=v, value=1).grid(row=3) Radiobutton(root, text="BLAU", padx = 20, variable=v, value=2).grid(row=4) Radiobutton(root, text="KLAR", variable=v, value=3).grid(row=5) Radiobutton(root, text="BASE", variable=v, value=4).grid(row=6) Radiobutton(root, text="5", variable=w, value=5).grid(row=3, column=2) Radiobutton(root, text="10", variable=w, value=6).grid(row=4, column=2) Radiobutton(root, text="15", variable=w, value=7).grid(row=5, column=2) Button(root, text="Abschicken", command=load ).grid(row=6, column=2) mainloop() this is how far i came thank you for trying to help!
×
×
  • Create New...