2012-11-01 27 views
0

我是Python新手。我試圖在Windows中運行this script (gencards.py),但他說我需要運行「qrencode命令」。我認爲這意味着this library,或更可能是windows portPython:在Windows中製作QRcodes

在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。

回答

1

錯誤消息意味着Windows不知道如何處理qrcode。檢查它是否已安裝在您的系統中,並且它的目錄是否包含在您的環境變量PATH環境變量

+0

謝謝你,這是我的問題。我需要在PATH中包含**目錄**,而不是_directory \ filename.exe_這是我第一天使用PATH,感謝您的幫助 –

1

嘗試打破問題,首先檢查是否可以運行程序(btw,是'grencode'還是'grcode '?)使用命令提示符。如果你不能,那麼再次檢查你的PATH設置。當您使用命令提示符成功時,請回到您的python腳本。