def clipboard(text,prnt, clear):
'''
Copy data to clipboard and start a thread to remove it after 20 seconds
'''
try:
pyperclip.copy(text)
print("Copied to clipboard")
except:
print("There was an error copying to clipboard. Do you have xsel installed?")
quit()
if prnt:
print(text)
if clear:
global myThread
if myThread and myThread.is_running():
myThread.stop()
myThread.join()
myThread = StoppingThread(target=timer, args=(20,text,))
myThread.start()
评论列表
文章目录