이야기박스
Python. Subprocess with * (asterisk) 본문
반응형
요약
Subprocess에 *(Asterisk)를 사용하고 싶다면, Shell=True가 필요합니다.
If shell is True, the specified command will be executed through the shell. This can be useful if you are using Python primarily for the enhanced control flow it offers over most system shells and still want convenient access to other shell features such as shell pipes, filename wildcards, environment variable expansion, and expansion of ~ to a user’s home directory. However, note that Python itself offers implementations of many shell-like features (in particular, glob, fnmatch, os.walk(), os.path.expandvars(), os.path.expanduser(), and shutil).
참조
https://docs.python.org/3/library/subprocess.html#popen-constructor
https://stackoverflow.com/questions/24670668/subprocess-call-to-remove-files/24670879
반응형
'Programming Language > Python' 카테고리의 다른 글
Python. 스레드 이야기 with GIL (0) | 2020.11.11 |
---|---|
Python. 대용량 파일을 스트림 프로세스로 분할하기 (0) | 2020.10.23 |