Skip to main content


Python - Creating an amazing tool with pyperclip (Auto-Copy-Paste)


install:- pip install pyperclip


URL:- https://pypi.org/project/pyperclip/


import time
import sys
import os
from time import strftime

sys.path.append(os.path.abspath("SO_site-packages"))

import pyperclip

recent_value = ""

D = time.strftime("%D")
r = time.strftime("%r")

while True:
    tmp_value = pyperclip.paste()
    if tmp_value != recent_value:
        recent_value = tmp_value
        print("Value changed: %s" % str(recent_value)[:20])
        with open('out_clipboard.txt', '+a') as output:
            try:
                output.write("[Start]----------------"+D+" "+r+"----------------\n")
                output.write("%s\n\n" % str(tmp_value))
                output.write("[End]-----------------------------------------------------------------\n\n\n")
            except:
                output.write("[Start]----------------" + D + " " + r+"----------------\n")
                output.write("%s\n\n" % str(tmp_value.encode('UTF-8')))
                output.write("[End]-----------------------------------------------------------------\n\n\n")
    time.sleep(0.1)

This tool will help you to automatically copy and paste any thing without pressing ctrl+V or paste from mouse menu.

Watch the video to get better understanding to how this tool works.

You can tweak a little to create your own custom tool.

Hope you like the tutorial.

Git:- https://github.com/joeldcosta/pysnake/blob/eec2cce0c2f3d63c14468aee03a7e5daec5c2285/Clipboard_AutoPaste_TOOL.py#L1


🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍

Popular Posts

Python underline string, Python underline text, Underline python print

Python pip - Installing modules from IDLE (Pyton GUI) for python 3.7

Top 40 Python - String Processing in Python | Working with String in Python

Top 11 Essential Python Tips and Tricks

Python Program - When was I born? / Date of Birth / MY BIRTHDAY (using Python3+)





Subscribe to our Channel


Follow us on Facebook Page

Join our python facebook groups



Join us on Telegram