Getting HTML from Windows clipboard
Usage
1 2 >>> cb = HtmlClipboard() 3 >>> cb.GetAvailableFormats() 4 [49161, 49562, 49339, 49560, 49561, 13, 1, 49334, 49335, 49333, 49344, 49478, 49171, 16, 7] 5 >>> cb.HasHtmlFormat() 6 True 7 >>> cb.GetFromClipboard() 8 >>> cb.htmlClipboardVersion 9 '0.9' 10 >>> cb.GetFragment() 11 '<p>Writing to the clipboard is <strong>easy</strong> with this code.</p>' 12 >>> cb.GetSource() 13 'http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/474121' 14 >>>
You can also put a html fragment to the clipboard as well.
See more detials in the recipe.