Changeset 97:28052c8e62c9 in xplra for misc/autosavesit.py
- Timestamp:
- 06/10/19 08:37:18 (5 years ago)
- Branch:
- default
- hg-Phase:
- (<MercurialRepository 3 'hg:/home/ivaradi/xplane/hg/xplra' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
misc/autosavesit.py
r88 r97 1 #!/usr/bin/env python 1 #!/usr/bin/env python3 2 2 # 3 3 # Program to automatically save the situation at certain intervals … … 24 24 xplane = XPlane() 25 25 26 print "Connecting to X-Plane..."26 print("Connecting to X-Plane...") 27 27 28 28 while not xplane.isConnected: … … 30 30 xplane.connect() 31 31 except: 32 print "Connection failed, sleeping..."32 print("Connection failed, sleeping...") 33 33 time.sleep(0.5) 34 34 35 print "Connected to X-Plane"35 print("Connected to X-Plane") 36 36 37 37 try: … … 44 44 os.rename(newPath, path) 45 45 46 print "Situation saved at " + time.strftime("%H:%M:%S")47 except OSError ,e:48 print "I/O error occured: " + str(e)49 except ProtocolException ,e:50 print "Protocol error occured: " + str(e)46 print("Situation saved at " + time.strftime("%H:%M:%S")) 47 except OSError as e: 48 print("I/O error occured: " + str(e)) 49 except ProtocolException as e: 50 print("Protocol error occured: " + str(e)) 51 51 time.sleep(interval) 52 except Exception ,e:53 print "Connection failed: " + str(e)52 except Exception as e: 53 print("Connection failed: " + str(e)) 54 54 try: 55 55 xplane.disconnect()
Note:
See TracChangeset
for help on using the changeset viewer.