-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
舅舅孩子,请问在Pycharm上怎样跑啊,太懵了 #84
Comments
你跑起来了吗?我跑起来了,也许可以一起交流 |
我写了个python工具类可以参考使用 import os
# 安装模块后
from amzqr import amzqr
class QrcodeUtil:
@staticmethod
def save_img(words: str = '', level: str = 'H', picture_path: str = None, colorized: bool = False,
save_name: str = 'qrcode.png', save_path: str = os.getcwd()):
"""
生成二维码
doc: https://github.com/x-hw/amazing-qr/blob/master/README-cn.md
:param words: 要生成的文字内容
:param level: 控制纠错水平,范围是L、M、Q、H,从左到右依次升高
:param picture_path: 用来将QR二维码图像与一张同目录下的图片相结合,产生一张黑白图片
:param colorized: 可以使产生的图片由黑白变为彩色的
:param save_name: 保存的文件名,格式可以是 .jpg, .png ,.bmp ,.gif , 如果输入图片picture_path 是 gif 则输出格式也要 .gif
:param save_path: 保存路径,默认存储位置是当前目录
"""
# 如果输入的保存名称包含后缀,则截取掉后缀
index = save_name.rfind(".")
if index != -1:
save_name = save_name[:index]
# 如果有引入图片则判断是否为 .gif 动图,是则修改保存名称后缀,否则统一输出 png 格式
if picture_path and picture_path.endswith(".gif"):
suffix = '.gif'
else:
suffix = '.png'
version, level, qr_name = amzqr.run(
words=words,
version=1,
level=level,
picture=picture_path,
colorized=colorized,
contrast=1.0,
brightness=1.0,
save_name=save_name + suffix,
save_dir=save_path
)
return version, level, qr_name |
您好,你的邮件我已收到!
|
收到。。
|
您好!
您正在找回密码,为确保是你本人操作,请在邮箱验证码输入框输入下方验证码:
658360
如果这不是你本人所为,请忽略。请勿向任何人泄漏您收到的验证码。
冬奥小助 账号团队敬上
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import way 太劝退新手了,给点提示都行
The text was updated successfully, but these errors were encountered: