I would like to code a python that adds every x seconds a value.
But when I add the time.sleep(x)
theres no output into the .txt file anymore.
And is there a way to stop the loop after a certain time?
Code:
f = open('Log.txt','a')
while True:
print("This prints once a second.", file=f)
time.sleep(1)