everything. See the example below. I would like to provide a string to the sched_action method, which indicates which Bot class method should be called. In the example below, I represented it as "bot.action ()", but I do not know how to do it correctly. Please, help
class Bot:
def work(self): pass
def fight(self): pass
class Scheduler:
def schedule_action(self,action):
bot = Bot()
bot.action()
scheduler = Scheduler()
scheduler.schedule_action('fight')
facha source
share