from tkinter import *

def write_to_file():
    fileContent = open("deliveries.txt","a")
    fileContent.write(depot.get()+"\n")
    fileContent.write(description.get()+"\n")
    fileContent.write(address.get("1.0",END)+"\n")
    fileContent.close()
    depot.delete(0,END)
    description.delete(0,END)
    address.delete("1.0",END)

app = Tk()
app.title("Head-Ex Deliveries")

Label(app,text = "Depot:").pack()
depot = Entry(app)
depot.pack()

Label(app,text = "Description:").pack()
description = Entry(app)
description.pack()

Label(app,text = "Address:").pack()
address = Text(app)
address.pack()

Button(app,text = "Save",width = 10,command = write_to_file).pack()
app.mainloop()

 

相关文章:

  • 2021-09-16
  • 2022-12-23
  • 2021-07-14
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
猜你喜欢
  • 2021-09-01
  • 2021-08-31
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2021-04-17
相关资源
相似解决方案