In Python I pull in data via Win32Com as a tuple:
((u'863579XK9',),)
How can I parse this so that I am left with just 863579XK9 so I can write that to a file?
Since this is a unicode string, you'd want to write it to a unicode encoded file:
import codecs
myfile = codecs.open('myfile.txt', encoding='utf8', mode='w')
data = ((u'863579XK9',),)
myfile.write(data[0][0].encode('utf8'))
myfile.close()
See Reading and Writing Unicode Data from the Python Unicode HOWTO.