0

Right now I have code in my script

def run(self):
        while True:
            try:
                self.one()
                self.two()
                self.three()
                self.four()
            except (IndexError, ProxyError, SSLError, ConnectionError, errno.ECONNREFUSED):
                print statusTime(self.index) + 'Bad Proxy'
                break

def jobWorker(username,password,proxy):
    bot = Bot(username,password,proxy)
    bot.start()
    bot.join()
    return

How can I tell python to continuously run def run(self) so basically keep looping through self.one(), self.two(), self.three(), self.four() so it doesnt stop. Right now each Bot stops at self.four() and doesnt start again at self.one()

2
  • And there is no exception thrown? Commented Mar 6, 2018 at 21:24
  • no without exception, i just want it to keep running Commented Mar 6, 2018 at 21:27

1 Answer 1

1

you can put the function with in

def __init__(self):  
    self.run()
Sign up to request clarification or add additional context in comments.

2 Comments

Ive put that at the end of my script however it still finishes after self.four()
you should put it with the same class of the method run(self)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.