So I'm writing a program that automatically timestamps Youtube videos, what I'm doing basically is getting a bunch of videos and putting them in one long video, so I have some code writted:
description = open("Description.txt", "r+")
description.truncate(0)
description.write("Timestamps:\n")
timestamps = [0.01, 0.08, 0.16, 0.30, 0.50, 1.05, 1.25] #These are just examples, usually this would be a list of 50 or so values
timeadd = 0
total = 0
for time in timestamps:
timeadd += 1
for add in range(timeadd):
total += timestamps[add]
print(total)
description.write(str(total) + "\n")
input("Done... ")
This works pretty successfully writes timestamps but any help to make this simpler would be appreciated, the problem is though it writes Timestamps like this: "2.1", what it means is "2:10", is there any way I could specify to add a 0 every time the Timestamp is in the tens place? I'm sorry if the answer is simple, I'm new to python.