from tkinter import *
import csv
from csv import *
master = Tk()
master.geometry("500x500") #Width x Height
from functools import partial
global g
g = int('0')
from datetime import date
x = date.today()
class tg:
def geld(v,tt):
global g
g = g + v
print(tt)
linew =[]
linew = list((x,tt,v))
f = open('D:\python/wert.csv', 'a+', newline='')
writer = csv.writer(f)
writer.writerow(linew)
def None_n():
f = open('D:\python/wert.csv', 'r')
reader = csv.reader(f)
linew = []
for row in reader:
linew.append(row)
i5 = 0
for row in reader:
print("Taschengeld Ausgabe")
for item in linew:
print(item)
b = Button(master, text="MCk12", height = 2, width = 7, command=partial(geld,200,'Mck12'))
b.grid(row=2, column=3, columnspan=2)
e = Button(master, text="MCk11", command=partial(geld,150,'Mck11'), height = 2, width = 7)
e.grid(row=3, column=3, columnspan=2)
o = Button(master, text="MCt12", command=partial(geld,100,'Mct12'), height = 2, width = 7)
o.grid(row=4, column=3, columnspan=2)
r = Button(master, text="MCt11", command=partial(geld,75,'Mct11'), height = 2, width = 7)
r.grid(row=5, column=3, columnspan=2)
n = Button(master, text="Otherk12", command=partial(geld,50,'Otherk12'), height = 2, width = 7)
n.grid(row=6, column=3, columnspan=2)
t = Button(master, text="Otherk11", command=partial(geld,30,'Otherk11'), height = 2, width = 7)
t.grid(row=7, column=3, columnspan=2)
x = Button(master, text="Othert12", command=partial(geld,30,'Othert12'), height = 2, width = 7)
x.grid(row=8, column=3, columnspan=2)
y = Button(master, text="Othert11", command=partial(geld,30,'Othert11'), height = 2, width = 7)
y.grid(row=9, column=3, columnspan=2)
q = Button(master, text="None", command=None_n, height = 2, width = 7)
q.grid(row=10, column=3, columnspan=3)
mainloop()