Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望增加功能:把剪贴板里的普通压缩保存成图片 #28

Open
naah69 opened this issue Jun 22, 2019 · 1 comment
Open

Comments

@naah69
Copy link

naah69 commented Jun 22, 2019

把剪贴板里的普通压缩保存成图片

@nisa123hj
Copy link

希望增加功能:将剪贴板中的文本内容压缩并保存为图片。

import requests

def send_image(image_url):
try:
# 发起网络请求,获取图片内容
response = requests.get(image_url)

    if response.status_code == 200:
        # 若成功获取图片内容,将其保存到文件
        with open('received_image.jpg', 'wb') as f:
            f.write(response.content)
        print("图片接收成功。")
    else:
        print(f"错误:接收到 HTTP 状态码 {response.status_code}")
except requests.exceptions.RequestException as e:
    print(f"错误:{e}")

if name == "main":
# 待获取的图片 URL,需要替换为实际的图片 URL
image_url = "https://example.com/image.jpg"
send_image(image_url)
Get More information on https://pooo.us/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants