Created
December 6, 2016 04:17
-
-
Save toaco/8920635bca9ff05f5d7f0993f71fe4d3 to your computer and use it in GitHub Desktop.
查看windows剪切板信息(View Windows Clipboard information)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 参考链接: 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