A
A
andreysuper12018-11-20 18:06:11
Python
andreysuper1, 2018-11-20 18:06:11

How to send a response if the values ​​stopped coming?

I use flask to get values ​​with a request like " 127.0.0.1:5000/?nickname=Test&money=12000&lvl=7&ho... " Every time a request comes in, it is parsed into variables and then written to report. In an infinite loop (in my opinion, it is not executed), there is a check that more than 60 seconds have passed since the last report arrived (if ( (int(time.time() - last_request_time)) > 60 & last_request_time!=-1) - the current time minus the time of the last report.) after which it is sent to VK and the values ​​​​are reset. How to solve the problem with the fact that the report is not sent to VK as a result?
I don't know how to attach the code. so I uploaded it to pastebin https://pastebin.com/gzBZpBp5

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
NaName, 2018-11-20
@NaName

print(report) before request.get in __main__, take out the countdown from if. exactly request.get and not request.post?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question