Skip to content

Instantly share code, notes, and snippets.

@toaco
Created December 6, 2016 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toaco/8920635bca9ff05f5d7f0993f71fe4d3 to your computer and use it in GitHub Desktop.
Save toaco/8920635bca9ff05f5d7f0993f71fe4d3 to your computer and use it in GitHub Desktop.
查看windows剪切板信息(View Windows Clipboard information)
# 参考链接: http://stackoverflow.com/questions/101128/how-do-i-read-text-from-the-windows-clipboard-from-python
import win32clipboard
win32clipboard.OpenClipboard()
for i in range(0XFFFF):
try:
data = win32clipboard.GetClipboardData(i)
print("Clipboard Formats Value: {}(HEX:{:X})".format(i, i))
print("ClipboardDate:\n{}".format(repr(data)))
print("------------------------------------------------------------------------")
except TypeError:
continue
win32clipboard.CloseClipboard()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment