ich bekomme folgende Fehlermeldung:
Code: Alles auswählen
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python32\lib\tkinter\__init__.py", line 1399, in __call__
return self.func(*args)
File "J:\JT_proj\python\Notizdesk\eintragen.pyw", line 26, in cofigfile
aktualisirung.write(zeit)
TypeError: must be str, not int
Code: Alles auswählen
from tkinter import*
import tkinter
import os
root = tkinter.Tk()
root.title("Neue Notiz eintragen")
root.geometry('520x380')
root.maxsize(900,500)
def save():
save = open("desknotiz.txt", 'w')
save.write(etext.get(0.0, 'end'))
save.close()
def ask_quit():
root.destroy()
root.mainloop()
def cofigfile(event):
zeit = regler.get()
aktualisirung = open('daten.txt', 'w')
aktualisirung.write(zeit)
aktualisirung.close()
def openfile():
externesProgramm = "notizdesk.pyw"
os.system(externesProgramm)
optionen = LabelFrame(root, text="Optionen")
optionen.place(relx=0.01, rely = 0.57, relwidth = 0.9, relheight = 0.32)
time = tkinter.Label(optionen, text = "Aktualisierungszeit in Sekunden")
time.place(relx=0.04, rely=0.07)
regler = Scale(optionen,from_=1, to=120, orient=HORIZONTAL, command = cofigfile)
regler.set(10)
regler.place(relx=0.04, rely=0.25, relwidth=0.34)
ok = Button(root,text = "OK",command = save)
ok.place(relx=0.04, rely=0.9, relwidth=0.17, relheight=0.08)
openprog = Button(root,text = "Anzeigen",command = open)
openprog.place(relx=0.3, rely=0.9, relwidth=0.17, relheight=0.08)
close = Button(root,text = "Schlie\xdfen",command = ask_quit)
close.place(relx=0.7, rely=0.9, relwidth=0.17, relheight=0.08)
root.mainloop()