SyntaxFix
Write A Post
Hire A Developer
Questions
On macOS, use subprocess.run to pipe your text to pbcopy:
subprocess.run
pbcopy
import subprocess data = "hello world" subprocess.run("pbcopy", universal_newlines=True, input=data)
It will copy "hello world" to the clipboard.