I have a 2d list in a Python utility that writes to a table using PyQt. I also want to copy all of the data from that list to the clipboard, with the caveat that it must be formatted for insertion into an excel document or a table in Word (as excel-formatted data generally is).
The question, then, is two-fold: 1) How do I go about formatting the data, stringwise, to match Excel's standards, and 2) how do I copy that to the clipboard?
From what I understand, Excel-formatted data, when viewed directly as plaintext, is XML-formatted in some way, but I don't know how to find out exactly what that XML looks like. I have not found a text editor that copies the formatting information upon pasting; they all just drop the formatting and paste the cell contents as plaintext. Copying to the clipboard once I have that should be pretty straightforward, I think.