내가 서브 프로세스를 사용하려고 한 복사 작업 (아래 코드)를 수행하기 위해 호출파이썬 하위 프로세스 오류
import subprocess
pr1 = subprocess.call(['cp','-r','./testdir1/*','./testdir2/'], shell = True)
을 내가 말하는 오류가 발생했습니다 :
cp: missing file operand
Try `cp --help' for more information.
때 나는 내가이 문제를 해결하려면 어떻게합니까
cp: cannot stat `./testdir1/*': No such file or directory
를 얻을 shell=False
으로 시도?
나는 2.6
추신 : 레드햇 리눅스 그놈 Deskop 버전 2.16.0 및 bash 쉘 및 Python을 사용하고 있습니다 , subprocess.call
에 문자열이 아닌 목록을 통과 나는 Problems with issuing cp command with Popen in Python에 게시 된 질문을 읽고, 그리고 내가 shell=True
를 사용하는 경우 :(
좋은 설명. 무슨 일이 일어 났는지 이해할 수있게 도와 줬어. – morganw09dev