파이썬 os.system()에 따옴표가 여러개 들어갈 경우 명령어가 정상적으로 실행되지 않는데, 이것은 파이썬의 문제가 아니라 윈도우의 문제이다.
다음과 같이 따옴표를 하나 더 넣으면 해결할 수 있다.
result = os.system('""pythonbugtest.exe" "test"')
인용:
다음과 같이 따옴표를 하나 더 넣으면 해결할 수 있다.
result = os.system('""pythonbugtest.exe" "test"')
인용:
yup, but unfortunately, it's a bug at the windows level, not in Python. from what원문: http://www.velocityreviews.com/forums/t350422-bug-in-ossystem.html
I can tell, the problem is that cmd.exe cannot parse the command string it's given
by the C-level system() call.
possible workarounds:
1. get rid of the quotes around the command name:
result = os.system('pythonbugtest.exe "test"')
2. add an extra quote (!) before the quoted command name:
result = os.system('""pythonbugtest.exe" "test"')
3. use os.spawn or the subprocess module instead.



Prev
Rss Feed