【问题标题】:Python: making QRcodes in WindowsPython:在 Windows 中制作二维码
【发布时间】:2012-11-01 06:39:54
【问题描述】:

我是 Python 新手。我正在尝试在 Windows 中运行this script (gencards.py),但他说我需要运行“qrencode 命令”。我假设这意味着this library,或者更可能是windows port

在python脚本中,他是这样使用qrencode的:

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

我已经通过可执行文件安装了 windows 库,我将 qrcode.exe 添加到 PATH,并尝试编辑 gencards.py 以使用“qrcode”或“qrcode.exe”,但我总是得到

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

我做错了什么?

我在 Windows7 x64 上使用 Python 2.7。

【问题讨论】:

    标签: python windows command external


    【解决方案1】:

    错误消息意味着 Windows 不知道如何处理 qrcode。检查它是否安装在您的系统中,以及它的目录是否包含在您的PATH 环境变量中

    【讨论】:

    • 谢谢,这是我的问题。我需要在 PATH 中包含 目录,而不是 directory\filename.exe 这是我使用 PATH 的第一天,感谢您的帮助
    【解决方案2】:

    尝试解决问题,首先检查您是否可以使用命令提示符运行程序(顺便说一句,它是“grencode”还是“grcode”?)。如果不能,请再次检查 PATH 设置。当您成功使用命令提示符时,请返回您的 python 脚本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-18
      • 2012-07-04
      • 1970-01-01
      相关资源
      最近更新 更多