I am currently having a problem because I cannot use the Win32clipboard library to retrieve the string that is in the clipboard in a variable on python.
From what I understand, Win32clipboard is part of the pywin32 library. I managed to install pywin32 after quite a bit of difficulty. So I do import pywin32
at the start of my program. However, when I run my program, python gives me an error, "name 'win32clipboard' is not defined". So I do "import win32clipboard" but still get the same error.
I really don't know how to do it. Thanks in advance.
Modification:
This is my code.
import pywin32
import win32clipboard
win32clipboard.OpenClipboard()
data = win32clipboard.GetClipboardData()
win32clipboard.CloseClipboard()
print (data)
and I get this error.
ModuleNotFoundError: No module named 'win32clipboard'
But when I write pip list
in the CMD, I found pywin32.
Screenshot CMD
I am using spyder 5.1.1 and Python 3.9 Thanks