I've got this piece of code that is doing as I want except I don't want the hours to be in the output. So I only want min:secs. I'm not sure how to get rid of the hours section or if it's possible at all. Any help would be appreciated.
import time
import datetime
def countdown(mins, seconds):
secs = mins * 60 + seconds
for i in range(secs + 1):
with open("Timer2.txt", "w+") as f:
print(datetime.timedelta(seconds=secs).resolution)
f.write(str(datetime.timedelta(seconds=secs)))
secs -= 1
time.sleep(1)
with open("Timer2.txt", "w") as f:
f.write("HT")
if __name__ == '__main__':
countdown(0, 10)
Thanks, Mitchell