MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / copyIfPossible

Function copyIfPossible

src/gamesbyexample/railfencecipher.py:85–91  ·  view source on GitHub ↗

Copy text to the clipboard if pyperclip is installed.

(text)

Source from the content-addressed store, hash-verified

83
84
85def copyIfPossible(text):
86 """Copy text to the clipboard if pyperclip is installed."""
87 try:
88 print('Copied to clipboard.')
89 pyperclip.copy(text) # Copy the text to the clipboard.
90 except:
91 pass # If pyperclip wasn't imported, do nothing.
92
93
94def encryptMessage(message, key):

Callers 2

encryptMessageFunction · 0.85
decryptMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected