Hi i have 2 python files and first file for data and its working with timer, example first file timer is set for 02/05/2023 - 02:50am
and when this date is come this file triggered and opens the order, but 2st file is checks this order status i mean 2st file is only for checks status and if this order succes its print 'SUCCES'
and if its not its print 'FAIL'
but it need to open like 2-3 days but its fail and says:
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(54, 'Connection reset by peer'))
i dont want to solve binance problem bec its nearly impossible, i found solution for this i write this command in terminal every time:
while true; do python3 /home/pi/Desktop/EREN/2-SHORTnormal/Loop.py && break; done
'This command help me for if its crash for anything like timestamp, time out or anything its start again '
but every time :(
example if this is my code:
Print('order is sent') #this is first files command and this work good
#and then
while status == succes
Print('order status:',status) #this is second files command
But second part crashes sometimes and i want to re open when it crashes until its status == success
but only second part not whole code.
Okey i think i found the solution:
import time #my 1.Command out the while loop, while True: try: #my 2.Command continue except: print("Program has crashed and restarts in 2 sec.") time.sleep(2) continue
if 2.Command is crash its print something and restart program. And 1.Command is run for only 1 time this is what i. want