Home > Blockchain >  I need to automatically repeat after a certain line. selenium python
I need to automatically repeat after a certain line. selenium python

Time:01-04

I need to automatically repeat after a certain line. example; There is a 200 line code and it will repeat 20 times after line 60

and other question; After a certain period of time, it should automatically turn itself off and start over. How can I do that?

CodePudding user response:

It looks like you are not very experienced in programming. For the first question you will have to work with a loop . To run a loop a specific number of times python has the range function that will help you.

The second question is different, because it has many possible answers. You migt have a look at schedulers, but before that maybe see why you would really need it in the first place. Sometimes there are easier ways to come to a similar solution!

CodePudding user response:

What do you mean with repeat? Repeat the entire code? To repeat a code part, do as following:

for x in range(0, 5):
     <code>
     <code>
  •  Tags:  
  • Related