Getting HTML From Windows Clipboard
Join the DZone community and get the full member experience.Join For Free
Get the code for class HtmlClipboard() by Phillip Piper here. Usage
>>> cb = HtmlClipboard() >>> cb.GetAvailableFormats() [49161, 49562, 49339, 49560, 49561, 13, 1, 49334, 49335, 49333, 49344, 49478, 49171, 16, 7] >>> cb.HasHtmlFormat() True >>> cb.GetFromClipboard() >>> cb.htmlClipboardVersion '0.9' >>> cb.GetFragment() 'You can also put a html fragment to the clipboard as well. See more detials in the recipe.
Writing to the clipboard is easy with this code.' >>> cb.GetSource() 'http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/474121' >>>
Opinions expressed by DZone contributors are their own.