From 96a6d1636599b938552f6acc4f407c61b7c9f9ff Mon Sep 17 00:00:00 2001 From: Chris Teubert Date: Tue, 25 Aug 2015 11:02:35 -0700 Subject: [PATCH] Python example fix Had to unpack tuple for string.format --- Python/src/playbackExample.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Python/src/playbackExample.py b/Python/src/playbackExample.py index 3934b0e..dfa4f52 100644 --- a/Python/src/playbackExample.py +++ b/Python/src/playbackExample.py @@ -7,18 +7,18 @@ def record(path, interval = 0.1, duration = 60): except: print "Unable to open file." return - + count = int(duration / interval) if count < 1: print "duration is less than a single frame." return - with xpc.XPlaneConnect("localhost", 49009, 0, 1000) as client: + with xpc.XPlaneConnect("localhost", 49009, 0, 1000) as client: print "Recording..." for i in range(0, count): try: posi = client.getPOSI() - fd.write("{0}, {1}, {2}, {3}, {4}, {5}, {6}\n".format(posi)) + fd.write("{0}, {1}, {2}, {3}, {4}, {5}, {6}\n".format(*posi)) except: print "Error reading position" continue