Is it possible for python to clear the clipboard? If so ... how can I do this?
I need this so in my quiz program, students cannot copy paste responses from the Internet and other files.
EDIT: I am using WinXP and Python 2.6
from ctypes import windll if windll.user32.OpenClipboard(None): windll.user32.EmptyClipboard() windll.user32.CloseClipboard()
No external libraries are required.
Yes, for this you need to use the PyWin32 module, which is the python module for Windows extent.
PyWin32
Take a look at your EmptyClipboard method .
The EmptyClipboard function empties the clipboard and frees data descriptors in the clipboard. The function then assigns the ownership of the clipboard to the window in which the clipboard is open.
Source: https://habr.com/ru/post/1394530/More articles:melt and add data using reshape2 functions in R - rCocos2d - the initial level of the application does not display correctly when the application loads, appears after reboot - uiviewHow to make a body (or div) of a fixed size always remain in the center of the page (even vertically!) - htmlHow to remove the "pending letter or number" from this Parsec error? - haskellUse javac with a few specific banks on the classpath in Linux (tilde does not expand after colon) - javaA serialized object works fine in my dev block, Heroku gives "TypeError (cannot throw an anonymous class class)" - ruby-on-railsEAR Version 1.4, 5, 6 - javaUPPER () and LOWER () are not required? - sqlHow to overwrite an existing cookie with a new value in PHP? - phpRails / Rspec - specification record including user verification and association membership - ruby-on-railsAll Articles