NameError: имя «QRCreator» не определено с использованием myqr и easygui в Python3

Я использую easygui и myqr в python, чтобы упростить создание классных qr-кодов. Код, который я использую, взят из журнала Linux Format. Весь код работает до последней строки.

#QRCodeGenarator.py
import easygui as eg
from MyQR import myqr

def QrCreator(URL, image, save):         

version, level, qr_name = myqr.run(

URL,
version = 1,
level = 'H',
picture= image,
colorized = True,
contrast = 1.0,
brightness = 1.0,
save_name = save,
save_dir="/Desktop/QRCodes"
)

URL = eg.enterbox(msg = "Please provide the URL for the QR code", title "Specify URL for QR code")
print(URL)

image = eg.fileopenbox(msg = "What image shall I use with the QR code?", title = "Open Image", default="/Desktop/QRCodes")
print(image)

save = eg.filesavebox(msg = "Save QR code as ?", default="/Desktop/QRCodes")
print(save)

eg.msgbox(msg="Your QR code has been saved!", title = "Save Complete")

QRCreator(URL, image, save)

Ошибка возникает в последней строке кода

QRCreator(URL, image, save)

Ошибка выглядит так в IDLE3

Traceback (most recent call last):
  File "/home/nyle/QRCodeGenarator.py", line 30, in <module>
    QRCreator(URL, image, save)
NameError: name 'QRCreator' is not defined

person Nyle Cohen    schedule 21.02.2018    source источник


Ответы (1)


Изменить def QrCreator(URL, image, save): на def QRCreator(URL, image, save):

person TUnkuri    schedule 24.02.2018