From 3d348670fa6eb062dda48bd4a503b482238b2512 Mon Sep 17 00:00:00 2001 From: ultramagnus_tcv Date: Mon, 19 Oct 2015 19:43:39 -0500 Subject: [PATCH] Adjusted text unpack so that output is converted from tuple to string. --- 3Slurp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/3Slurp.py b/3Slurp.py index 84b5802..7131b1a 100644 --- a/3Slurp.py +++ b/3Slurp.py @@ -5,7 +5,8 @@ def readUnpack(bytes, **options): if options.get("type") == 't': #print 'DEBUG: In t' SOS = SOSfile.read(bytes) - return unpack('%ss' % bytes, SOS) + text_unpacked = unpack('%ss' % bytes, SOS) + return ''.join(text_unpacked) if options.get("type") == 'b': #print 'DEBUG: In b', bytes @@ -23,7 +24,7 @@ print("\033c"); SOSfile = open('SOSCFFA.DRIVER', 'rb') filetype = readUnpack(8, type = 't') -if 'SOS DRVR' in filetype: +if filetype == 'SOS DRVR': print "This is a proper SOS file." print "Filetype is: %s." % (filetype) else: