daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from tkinter import *
  2. def save_data():
  3.     fileD = open("deliveries.txt", "a")
  4.     fileD.write("Depot:\n")
  5.     fileD.write("%s\n" % Radiobutton.get())
  6.     fileD.write("Description:\n")
  7.     fileD.write("%s\n" % description.get())
  8.     fileD.write("Address:\n")
  9.     fileD.write("%s\n" % address.get("1.0", END))
  10.     depot.delete(0, END)
  11.     description.delete(0, END)
  12.     address.delete("1.0", END)
  13. app = Tk()
  14. app.title('Head-Ex Deliveries')
  15.  
  16.  
  17. Label(app, text = "Depot:").pack()
  18. Radiobutton(app, text = "Cambridge, MA", value = "Cambridge, MA").pack()
  19. Radiobutton(app, text = "Cambridge, ON", value = "Cambridge, ON").pack()
  20. Radiobutton(app, text = "Cambridge, UK", value = "Cambridge, UK").pack()
  21. Radiobutton(app, text = "Cambridge, JA", value = "Cambridge, JA").pack()
  22. Radiobutton(app, text = "Cambridge, ID", value = "Cambridge, ID").pack()
  23. Radiobutton(app, text = "Cambridge, MO", value = "Cambridge, MO").pack()
  24. Radiobutton(app, text = "Cambridge, NY", value = "Cambridge, NY").pack()
  25.  
  26. Label(app, text = "Description:").pack()
  27. description = Entry(app)
  28. description.pack()
  29.  
  30. Label(app, text = "Address:").pack()
  31.  
  32. address = Text(app)
  33. address.pack()
  34.  
  35. Button(app, text = "Save", command = save_data).pack()
  36. app.mainloop()
RAW Paste Data
Top