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
# How to access Clipboard data in Windows from Python 3 | |
def win32_clipboard(): | |
import ctypes | |
ctypes.windll.user32.OpenClipboard(None) | |
pc = ctypes.windll.user32.GetClipboardData(1) | |
return ctypes.c_char_p(pc).value | |
def win32_clipboard_paste(txt): | |
import ctypes | |
ctypes.windll.user32.OpenClipboard(None) |
NewerOlder