from easytello import tello from TelloModule import TelloModule drone = tello.Tello() mod = TelloModule() def main(): drone.takeoff() while 1: line = mod.get_block_dist() if int(line[1]) > 400: drone.forward(20) if int(line[1]) < 300: drone.back(20) try: main() except KeyboardInterrupt: drone.land()