을 to, 각 명령은 지나가는 목록의 항목이어야합니다. 그럼, 당신이해야 할 것은입니다 : 여기
License = subprocess.check_output(['./generateLicense.sh', '-firstargument', '1', '-secondargument', '2', '-thirdargument', '3'])
당신이
check_output
에 전달되는 목록에서 하나의 문자열로 다중 인수 명령을 통과 할 때 무슨 일이 일어나고 있는지 보여주기 위해 다른 명령을 사용하여 문제의 복제입니다 :
>>> import subprocess
>>> subprocess.check_output(["ls -a"])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 566, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
당신이 실제로 더 일관성있는 뭔가 얻을 것이다 파이썬 3에서 이렇게 :
FileNotFoundError: [Errno 2] No such file or directory: 'ls -a'
라이센스 = subprocess.check_output를 ([ './ generateLicense.sh', '-firstargument', '1' , '-secondargument', '2', '-thirdargument', '3'])는 여전히 같은 오류를 발생시킵니다. – Layroni