问题
I am trying to learn python using https://automatetheboringstuff.com.
While on IDLE (Python 3.5 - 64 Bits), windows 8.1), pyperclip.copy('test') gives the following error message
pyperclip.copy('test') Traceback (most recent call last): File "", line 1, in pyperclip.copy('test') File "C:\Python\lib\site-packages\pyperclip__init__.py", line 53, in _copyWindows ctypes.cdll.msvcrt.wcscpy(ctypes.c_wchar_p(pchData), text) OSError: exception: access violation writing 0x0000000000000000
Any help is appreciated !
回答1:
The problem appears to be the 64-bit version of Python on some windows PCs.
I had this problem when using the same version of Python 3.5 as you (64-bit - Windows x86-64 executable installer). I didn't have this problem in Python 3.4, but I am using the 32-bit version of that release. I just downloaded and installed the 32-bit version of Python 3.5 (Windows x86 executable installer) and it doesn't give me the issue when using pyperclip.
来源:https://stackoverflow.com/questions/32676543/pyperclip-copy-causing-an-oserror