JavaScript
x
8
1
import time
2
3
while True:
4
for x in range(1, 1000, 1) :
5
link = ("example.com/" + str(x))
6
print(link)
7
time.sleep(0.1)
8
Here is the code, I need the link variable to be written to a file like
JavaScript
1
4
1
example.com/1
2
example.com/2
3
example.com/3
4
and so on
The problem i ran into before posting this is that when I write something to a file (example.com/1) in the next cycle the text gets replaced by the new output (example.com/2). Is there a way for me to write to the file in such a way that the script wouldnt replace the already existing lines and start from a new one every cycle
P.S this is my first post and im new to python, pls dont attack me if I did anything wrong!