4 ms·
import pyperclip import re url_regex = re.compile('^(ftp|https?)') while True: text = pyperclip.waitForNewPaste() if url_regex.mat
by mike_hock 5y ago
import pyperclip
import re
url_regex = re.compile('^(ftp|https?)')
while True:
text = pyperclip.waitForNewPaste()
if url_regex.match(text):
print(text)
Seems like a clean, blocking API. I peeked at the source code. It's polling at 10ms intervals under the hood.
... LOL.