File 3

from tello import Tello
import sys
from datetime import datetime
import time

seconds = time.time()
result = time.localtime(seconds)
most=str(str(result.tm_year)+'-'+str(result.tm_mon)+'-'+str(result.tm_mday)+'-'+str(result.tm_hour)+'-'+str(result.tm_min)+'-'+str(result.tm_sec))
start_time =str(most)

file_name = sys.argv[1]

f = open(file_name, "r")
commands = f.readlines()

tello = Tello()
for command in commands:
if command != '' and command != '\n':
command = command.rstrip()

if command.find('delay') != -1:
sec = float(command.partition('delay')[2])
print('delay %s' % sec)
time.sleep(sec)
pass
else:
tello.send_command(command)

log = tello.get_log()

nev=('Adatok-'+str(start_time) + '.txt')
out = open(nev, 'w+')
for stat in log:
stat.print_stats()
str = stat.return_stats()
out.write(str)

Created with Mobirise ‌

Free Web Site Maker