Code: Alles auswählen
# -*- coding: cp1252 -*-
from Tkinter import*
from ScrolledText import*
def arbeite():
f = open('DeineTipps.txt', "r")
sporteingabe=str(sportEntry.get())
mann1eingabe=str(mann1ein.get())
mann2eingabe=str(mann2ein.get())
tippein1eingabe=str(tippein1.get())
tippein2eingabe=str(tippein2.get())
ausgabefeld.insert(END,'Du hast im "'+sporteingabe+'" bei\n"'+mann1eingabe+'" gegen "' +mann2eingabe+ ' ",\n'+tippein1eingabe+' : '+tippein2eingabe+' getippt!\n\n')
f = open('DeineTipps.txt', "w")
f.write('Du hast im "'+sporteingabe+'" bei\n"'+mann1eingabe+'" gegen "' +mann2eingabe+ '",\n'+tippein1eingabe+' : '+tippein2eingabe+' getippt!\n\n')
def save():
ausgabefeld.insert(END,'Die Daten wurden gespeichert...\n\n')
hf = Tk()
frame1 = Frame(hf,width=300,height=450)
frame1.pack()
willk=Label(frame1, text='Willkommen!',font=("Arial",12,"bold"))
willk.place(x=20,y=20)
text1=Label(frame1, text='Mit diesem Programm kannst du deinen',font=("Arial",9,"normal"))
text1.place(x=20,y=45)
text2=Label(frame1, text='Tipp für ein Spiel abgeben!',font=("Arial",9,"normal"))
text2.place(x=20,y=63)
sportLabel=Label(frame1, text='Sport:', font=("Arial",9,"normal"))
sportLabel.place(x=20,y=105)
sportEntry=Entry(frame1, width=20)
sportEntry.place(x=110,y=105)
mann1=Label(frame1, text='Mannschaft 1:',font=("Arial",9,"normal"))
mann1.place(x=20,y=135)
mann2=Label(frame1, text='Mannschaft 2:',font=("Arial",9,"normal"))
mann2.place(x=20,y=165)
mann1ein=Entry(frame1, width=20)
mann1ein.place(x=110,y=135)
mann2ein=Entry(frame1, width=20)
mann2ein.place(x=110,y=165)
tipp=Label(frame1, text='Dein Tipp:',font=("Arial",9,"normal"))
tipp.place(x=20,y=195)
tippein1=Entry(frame1,width=8)
tippein1.place(x=110,y=195)
tippein2=Entry(frame1,width=8)
tippein2.place(x=183,y=195)
doppelpkt=Label(frame1, text=':',font=("Arial",10,"bold"))
doppelpkt.place(x=168,y=192)
workButton=Button(frame1, text='Tipp abgeben!',font=("Times New Roman",12,"italic"),width=13,relief='groove',command=arbeite)
workButton.place(x=110,y=230)
saveButton=Button(frame1, text='Save!', font=("Times New Roman",12,"italic"),width=8,relief='groove',command=save)
saveButton.place(x=20,y=230)
ausgabefeld=ScrolledText(frame1, width=42,height=10)
ausgabefeld.place(x=12,y=285)
werbung=Label(frame1, text='www.skunkk-online.de.vu',font=("Arial",7,"normal"))
werbung.place(x=90,y=425)
hf.mainloop()