Advertisement
Melanie1204

Untitled

Oct 11th, 2023
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.32 KB | None | 0 0
  1. from tkinter import messagebox,ttk
  2. import tkinter as tk
  3. window=tk.Tk()
  4. window.geometry("500x500")
  5. label=tk.Label(window)
  6. label["text"]="Anzahl an Kanalpunkten"
  7. entry=tk.Entry(window,bd=5)
  8. label.pack()
  9. entry.pack()
  10. window.update()
  11.  
  12. Luny={
  13.     "Nachricht hervorheben":100,
  14.     "Trinken": 200,
  15.     "Snackies": 300,
  16.     "Haltung annehmen" : 300,
  17.     "Zufälliges Abo-Emote": 600,
  18.     "Confetti": 1.200,
  19.     "Bonk": 2.00,
  20.     "RATATATATATA": 3.000,
  21.     "Pat the Luny": 4.000,
  22.     "Gangster-Luny": 6.600,
  23.     "Scrubbies": 7.000,
  24.     "Who let the Woo out": 9.000,
  25.     "Kartenflex": 100.000,
  26.     "The Woo Plush": 1.000000,
  27. }
  28.  
  29. if entry==0:
  30.     entry.set()=="0"
  31.  
  32.  
  33.    
  34. Auswahl=ttk.Combobox(
  35.     state="readonly",
  36.     values=["Luny","Laphi","Jinja","Mona","Finstey"]
  37. )
  38. Auswahl2=ttk.Combobox()
  39. state="readonly"
  40. if Auswahl.get()=="Luny":
  41.      for key,value in Luny.items():
  42.          
  43.         values=[str(Luny.key +":"+ Luny.value)]
  44.  
  45. def display():
  46.     selection=Auswahl.get()
  47.     messagebox.showinfo(
  48.         message=f"Deine Anzahl an Kanalpunkten bei {selection} ist gleich: {entry.get()}",
  49.         title="Selection"
  50.     )
  51. window.update()
  52. Auswahl.place(x=180, y=100)
  53. Auswahl2.place(x=180,y=170)
  54. button = ttk.Button(text="Display selection", command=display)
  55. button.place(x=180, y=250)
  56. window.mainloop()
  57.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement