Created
April 27, 2016 07:20
-
-
Save silmang/1759a2b8832876274a636c5d38b5cf9a to your computer and use it in GitHub Desktop.
[python] get windows clipboard text data
This file contains hidden or 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
| import ctypes | |
| def winGetClipboard(): | |
| ctypes.windll.user32.OpenClipboard(0) | |
| pcontents = ctypes.windll.user32.GetClipboardData(13) # CF_UNICODETEXT | |
| data = ctypes.c_wchar_p(pcontents).value | |
| ctypes.windll.user32.CloseClipboard() | |
| return data | |
| print (winGetClipboard()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
there is any program to set clipboard data