Question - How do I fix my code so I don't get this error? I'd like output
to be placed in my clipboard buffer (I'm on a Mac)?
What I've tried - Printing output
to the console works great! I've tried uninstalling and reinstalling via pip
pyperclip
.
What I notice - my code doesn't call 'NSString' so I haven't a clue where I've gone astray. object
is the <class 'str'>
.
Where might I find helpful documentation on how to solve this sort of problem that might come up in the future?
#!/usr/bin/env python3
# encoding: utf-8
import pyperclip
output = f"""
Below are the titles and a one-sentence summary/meaning/'stinger' of zettel
I've birthed into existence and their ideas I'm grappling.
"""
# print(output)
# print(type(output))
pyperclip.copy(output)
Output
(base) ➜ ~ python wiwov1.py
Traceback (most recent call last):
File "/Users/will/wiwov1.py", line 79, in <module>
pyperclip.copy(output)
File "/usr/local/lib/python3.9/site-packages/pyperclip/__init__.py", line 659, in lazy_load_stub_copy
return copy(text)
File "/usr/local/lib/python3.9/site-packages/pyperclip/__init__.py", line 136, in copy_osx_pyobjc
newStr = Foundation.NSString.stringWithString_(text).nsstring()
AttributeError: module 'Foundation' has no attribute 'NSString'