import wx
import qrcode
from PIL import Image
from math import sqrt
class IsPrimeFrame(wx.Frame):
def __init__(self,superion):
wx.Frame.__init__(self, parent=superion, title=u'My First Form', size=(400, 200))
panel=wx.Panel(self)
panel.SetBackgroundColour('write')
wx.StaticText(parent=panel, label='InPut a integer:',pos=(10, 10))
self.inputN = wx.TextCtrl(parent=panel, pos=(120, 10))
wx.StaticText(parent=panel, label='photo:', pos=(10, 40))
self.inputP = wx.TextCtrl(parent=panel, pos=(120, 40))
self.result = wx.StaticText(parent=panel, label='',pos=(10, 70))
self.buttonCheck = wx.Button(parent=panel, label='Check', pos=(70, 90))
self.Bind(wx.EVT_BUTTON, self.OnButtonCheck, self.buttonCheck)
self.buttonQuit = wx.Button(parent=panel, label='Quit',pos=(150, 90))
self.Bind(wx.EVT_BUTTON, self.OnButtonQuit, self.buttonQuit)
def OnButtonCheck(self, event):
self.result.SetLabel('')
try:
num = self.inputN.GetValue()
photo = self.inputP.GetValue()
except BaseException as e:
self.result.SetLabel('not a integer')
return
qr = qrcode.QRCode(
version=2,
error_correction=qrcode.constants.ERROR_CORRECT_H,
box_size=10,