提交 f07837a5 编写于 作者: Z zhangbaoxiang

Wed Apr 10 01:37:00 CST 2024 inscode

上级 2eebcf6c
run = "pip install -r requirements.txt;python main.py"
language = "python"
[packager]
AUTO_PIP = true
......@@ -9,4 +10,7 @@ PATH = "${VIRTUAL_ENV}/bin:${PATH}"
PYTHONPATH = "$PYTHONHOME/lib/python3.10:${VIRTUAL_ENV}/lib/python3.10/site-packages"
REPLIT_POETRY_PYPI_REPOSITORY = "http://mirrors.csdn.net.cn/repository/csdn-pypi-mirrors/simple"
MPLBACKEND = "TkAgg"
POETRY_CACHE_DIR = "/root/${PROJECT_DIR}/.cache/pypoetry"
\ No newline at end of file
POETRY_CACHE_DIR = "/root/${PROJECT_DIR}/.cache/pypoetry"
[debugger]
program = "main.py"
print('欢迎来到 InsCode')
\ No newline at end of file
print('欢迎来到 InsCode')import pyqrcode
import time
import pyautogui
# 将文本转换为二维码并保存为图片
def create_qrcode(text, filename):
qr = pyqrcode.create(text)
qr.png(filename, scale=6)
# 取得屏幕特定区域的截图并保存为图片
def capture_screen(x1, y1, x2, y2, filename):
im = pyautogui.screenshot(region=(x1, y1, x2-x1, y2-y1))
im.save(filename)
# 发送数据
def send_data(data):
# 将数据转换为二维码并保存为图片
create_qrcode(data, 'data.png')
# 取得屏幕特定区域的截图并保存为图片
capture_screen(100, 100, 500, 500, 'screen.png')
# 将二维码图片叠加到截图上并保存为最终图片
data_im = pyautogui.screenshot('data.png')
screen_im = pyautogui.screenshot('screen.png')
screen_im.paste(data_im, (100, 100))
screen_im.save('final.png')
# 测试发送数据
data = 'Hello world!'
send_data(data)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册