A
A
artemiusor2019-07-28 19:18:24
Python
artemiusor, 2019-07-28 19:18:24

How to make a loop run more than 24 times?

Here is part of the code:

def loginn():
        gettime = time.time()
        print(gettime)
        while (True):
            if (time.time() - gettime > 60 * 45):
                client.login()
                gettime = time.time()

The loop needs to log in to Gspread every 45 minutes because the access token flies every hour, but the loop only runs 24 times. I am new to Python, please explain what is wrong)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question