Created
February 3, 2020 20:20
-
-
Save davidlares/646070f6e971ba7c4035d1146e2bbe14 to your computer and use it in GitHub Desktop.
A Python 2.x script for demonstrating the Pyperclip package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import pyperclip | |
import time | |
p_list = [] # list datatype for password clipboard selection | |
while True: | |
# evaluating existence | |
if pyperclip.paste() != 'None': | |
value = pyperclip.paste() # paste content | |
if value not in p_list: | |
p_list.append(value) # appending to hthe list | |
# priting values | |
print(p_list) | |
# force 3 sec sleep for checking the clipboard status | |
time.sleep(3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In some cases, you will be in scenarios where the clipboard element is empty. In that particular case, the list structure will be printed instead of evaluating the "None" value as "empty".
In Windows OS's you can create a shortcut in the Desktop with this content. in order to clear programmatically the clipboard tool: the content for that shortcut is
cmd /c “echo off | clip”
. You can use this tiny small script for any purpose at all.