I've written music player with basic functionality (play, pause, playlist) using tkinter and pygame.mixer.
Now I want to do plot that shows how many minutes you've been listening music per days of week. For this I'm using matplotlib and pandas.
I want to do it like this. When you press button "Play", program starts counting time. Then when you press "Pause" it stops counting, and pushes how many minutes has passed into csv file, or changes values which are already here.
There is buttons that I created, and want to change so they work like stopwatch and changes csv file.
def play():
pygame.mixer.music.load(playlist.get(tkr.ACTIVE))
var.set(playlist.get(tkr.ACTIVE))
pygame.mixer.music.play()
pygame.mixer.music.set_volume(Volume.get())
print(pygame.mixer.music.set_volume())
print(Volume.get())
def pause():
pygame.mixer.music.pause()
def resume():
pygame.mixer.music.unpause()
My csv file looks like this: