On Fri, Sep 13, 2013, at 12:09, random...@fastmail.us wrote: > Anyway, to match behavior found in other applications when pasting from > the clipboard, I would suggest using: > > if s.contains('\0'): s = s[:s.index('\0')] > > Which will also remove non-null bytes after the first null (but if the > clipboard contains these, it won't be pasted into e.g. notepad).
I did some testing and confirmed you MUST do this - if you copy multiple things from Excel, it may reuse this buffer and not clear the end of it. -- https://mail.python.org/mailman/listinfo/python-list