Windowsのpythonスクリプト内からqt5 .uiファイルをpythonに変換するために呼び出しpyuic5
を試みています。subprocess.Popen
command = "pyuic5 -x " + filein + " -o " + fileout
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=None, shell=False, cwd=folderPath)
output = process.communicate()
次のエラーが表示されます。
Traceback (most recent call last):
File "N:\My Documents\Code\Python Projects\Work projects\PyQtConverter\src\fonctions.py", line 36, in convert_qt_2_py
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=None, shell=False, cwd=folderPath)
File "C:\Python35\lib\subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "C:\Python35\lib\subprocess.py", line 997, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable
問題は呼び出しにあるようpyuic5
です (ただし、windows cmd で有効なコマンドとして認識されますか?)。設定shell=True
すると問題は解決しますが、このオプションはセキュリティ上のリスクになる可能性があり、推奨されないことを読んでいます。私は違うことをするべきですか?