Comments (7)
Nice article - useful and easy to follow! Thank you very much!
from abdus.dev.
Thanks for your sharing, great project!
I intend to write some python script to get mem cache updated and check if have some keyword which pre-define will active telebot and send to bot to save.
I tried but don't know how to continue with your code to get the text content in your code, your code.
Other library is use time interval and paste content then check if changed. Seem it's different with yours solution is get update by OS event.
Below is using paperclip library, hope you cuold help me out with the same meaning by reuse your project. Thanks Abdus!
#coding:utf-8
import pyperclip
import datetime as dt
import time
import telebot
bot = telebot.TeleBot("Telebot_Token")
bot.send_message(chat_id, dt.datetime.now().strftime('%Y-%m-%d %H:%M:%S') + ' Chào ngày mới', disable_notification = True)
#bot.send_photo(1838241701, photo = open('out.png', 'rb'))
lastContent = ''
while True:
clipboard_content = pyperclip.paste()
if clipboard_content:
if clipboard_content != lastContent:
print(clipboard_content)
lastContent = clipboard_content
if 'BGia' in clipboard_content or 'BG' in clipboard_content or 'XNĐH' in clipboard_content or 'XNDH' in clipboard_content:
bot.send_message(1838241701, clipboard_content, disable_notification = True)
time.sleep(10)
from abdus.dev.
Finally i did it Abdus, using your async workflow and dumpclip.exe. a little confuse when reading your code because too stupid to know where to get the clip content from your pure python code.
if name == "main":
async def main():
async for clip in monitor_clipboard():
print(clip)
# Insert check match keyword and use bot to send note content to Telegram chat
Many thanks Abdus!
from abdus.dev.
What is the benefit of this code:
while th.is_alive():
th.join(0.25)
As opposed to merely this:
th.join()
Great post, btw! Thank you!
from abdus.dev.
The benefit of using while th.is_alive(): th.join(0.25)
is that it allows the main thread to do other things while waiting for th
to finish, without being blocked. If you just had th.join()
the main thread wouldn't be able to throw KeyboardInterrupt
when you hit Ctrl + C
until the thread finished executing, for example.
from abdus.dev.
Hi, thanks for this code.
I used it to extend my Raspberry pi zero macro keyboard use case.
You have a password in a password manager but your remote server doesn't allow the use of CTRL+V
Thanks to you I transmit all clipboard changes to a key on my macro keyboard.
When I press the key the macro keyboard 'types' the password.
from abdus.dev.
@emielvanberlo Glad to be of help 🙏
from abdus.dev.
Related Issues (11)
- post: ffmpeg thumbnail HOT 1
- post: upsert on sqlite3
- Using ASP.NET Identity with external providers only
- posts/fixing-wsl2-localhost-access-issue/ HOT 19
- Use giscus for comments HOT 1
- posts/python-monitor-usb/ HOT 1
- posts/aspnetcore-inject-cancellationtoken-with-timeout/ HOT 1
- posts/django-orm-standalone/ HOT 3
- posts/powershell-file-metadata-guide/ HOT 1
- posts/powershell-hotspot/ HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abdus.dev.