Created
May 22, 2023 16:01
-
-
Save seagalputra/b1efac2224dd236613913065204165ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tkinter import * | |
# car = ["Agya", "Calya", "Pajero"] | |
# { | |
# merk: "Agya", | |
# plat: "...", | |
# harga: "Rp 10.000" | |
# } | |
car = [ | |
{ "id": 1, "merk": "Agya", "plat": "", "harga": "" }, # 0 | |
{ "id": 2, "merk": "Calya", "plat": "", "harga": "" } # 1 | |
] | |
def info(car): | |
# panggil sqlite | |
stmt = "INSERT INTO mobil (merk, plat, harga) VALUES (?, ?, ?)" | |
# sqlite.execute(stmt, car["merk"], car["plat"], car["harga"]) | |
for index in range(len(car)): | |
c = car[index] # { "id": 1, "merk": "Agya", "plat": "", "harga": "" } | |
radio_button = RadioButton(c["merk"], command=lambda: info(c)) | |
radio_button.grid(row=0, column=1) | |
# ... | |
# message = c["merk"] + " harganya " + c["harga"] + " dengan plat nomer " + c["plat"] | |
# DialogBox(message) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment