from PIL import Image
import matplotlib.pyplot as plt
import qrcode
import image
import easygui
import tkinter as tk
from tkinter import filedialog
import image
tk.Tk().withdraw()
try:
qr_image = qrcode.make(easygui.enterbox('请输入二维码内容', '二维码生成器'))
easygui.msgbox("生成完毕", "二维码生成器", "好的")
qr_image.show()
if easygui.ynbox("是否保存?", "二维码生成器", ("是", "否")):
qr_image.save(".png")
easygui.msgbox("已保存", "二维码生成器", "好的")
except Exception as error:
easygui.msgbox("报错:" + str(error)+"\n检测到错误类型为:" +
str(sys.exc_info()[0]), "二维码生成器", "好的")