def on_open(ws): print("### OPEN ###") if simulation is True: simulator = Simulator(ws) simulator.start_simulation()