简体   繁体   English

Python:在Windows中制作QR码

[英]Python: making QRcodes in Windows

I'm new to Python. 我是Python的新手。 I'm trying to run this script (gencards.py) in Windows, but he says I need to run "the qrencode command". 我正在尝试在Windows中运行此脚本(gencards.py) ,但他说我需要运行“qrencode命令”。 I assume that means this library , or the more likely the windows port . 我认为这意味着这个库 ,或者更可能是windows端口

In the python script, he uses qrencode as so: 在python脚本中,他使用qrencode如下:

os.system("qrencode -o .tempqr.png -s 30 -m 0 -l H " + serial)

I've installed the windows library via the executable, I added qrcode.exe to PATH, and tried editing gencards.py to use "qrcode" or "qrcode.exe" but I always get 我已经通过可执行文件安装了Windows库,我将qrcode.exe添加到PATH,并尝试编辑gencards.py以使用“qrcode”或“qrcode.exe”但我总是得到

'qrcode' is not recognized as an intrnal or external command, operable program or batch file.

What am I doing wrong? 我究竟做错了什么?

I'm using Python 2.7 on Windows7 x64. 我在Windows7 x64上使用Python 2.7。

the error message means that Windows does not know what to do with qrcode . 错误消息表示Windows不知道如何处理qrcode Check if it's installed in your system, and if it's directory is included in your PATH environment variable 检查它是否已安装在您的系统中,以及它的目录是否包含在您的PATH环境变量中

Try to break the problem down, by first checking if you can run the programm (btw, is it 'grencode' or 'grcode'?) using a command prompt. 尝试通过首先检查是否可以使用命令提示符运行程序(顺便说一句,是'grencode'还是'grcode'?)来解决问题。 If you can't then check your PATH settings again. 如果您不能再检查您的PATH设置。 When you succeeded with the command prompt get back to your python script. 当您使用命令提示符成功返回到python脚本时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM