# subprocess

* python run bash script
* [https://stackoverflow.com/questions/13745648/running-bash-script-from-within-python](https://stackoverflow.com/questions/13745648/running-bash-script-from-within-python)
* [https://stackoverflow.com/questions/4256107/running-bash-commands-in-python](https://stackoverflow.com/questions/4256107/running-bash-commands-in-python)
* python subprocess
* python output subprocess to file
* [https://www.annasyme.com/docs/python-subprocess.html](https://www.annasyme.com/docs/python-subprocess.html)
* subprocess doc
* [https://docs.python.org/3/library/subprocess.html](https://docs.python.org/3/library/subprocess.html)
* subprocess popen run
* [https://stackoverflow.com/questions/39187886/what-is-the-difference-between-subprocess-popen-and-subprocess-run](https://stackoverflow.com/questions/39187886/what-is-the-difference-between-subprocess-popen-and-subprocess-run)
* subprocess input string instead list
* [https://stackoverflow.com/questions/69081720/passing-input-to-subprocess-popen-at-runtime-based-on-stdout-string](https://stackoverflow.com/questions/69081720/passing-input-to-subprocess-popen-at-runtime-based-on-stdout-string)
* subprocess export environment variable
* [https://stackoverflow.com/questions/2231227/python-subprocess-popen-with-a-modified-environment](https://stackoverflow.com/questions/2231227/python-subprocess-popen-with-a-modified-environment)
* popen python
* [https://www.cnblogs.com/security-darren/p/4733368.html](https://www.cnblogs.com/security-darren/p/4733368.html)
* python 呼叫其他程式
* [https://medium.com/@alan81920/python-%E5%91%BC%E5%8F%AB%E5%85%B6%E4%BB%96%E7%A8%8B%E5%BC%8F-18a202c8b700](https://medium.com/@alan81920/python-%E5%91%BC%E5%8F%AB%E5%85%B6%E4%BB%96%E7%A8%8B%E5%BC%8F-18a202c8b700)
* subprocess.run('ls -l')
* [https://realpython.com/python-subprocess/](https://realpython.com/python-subprocess/)
* 配合 shlex，subprocess 指令更簡單
* [https://docs.python.org/zh-tw/3/library/shlex.html](https://docs.python.org/zh-tw/3/library/shlex.html)





* module' object has no attribute 'run' subprocess
* [https://stackoverflow.com/questions/40590192/getting-an-error-attributeerror-module-object-has-no-attribute-run-while](https://stackoverflow.com/questions/40590192/getting-an-error-attributeerror-module-object-has-no-attribute-run-while)
* \[Errno 2] No such file or directory: 'export': 'export'
* [https://stackoverflow.com/questions/3929319/subprocess-module-errors-with-export-in-python-on-linux](https://stackoverflow.com/questions/3929319/subprocess-module-errors-with-export-in-python-on-linux)
* AttributeError: 'str' object has no attribute 'fileno'
* 要給的是物件的 object，而非 filename (需要先被 read)
* [https://stackoverflow.com/questions/31488688/attributeerror-str-object-has-no-attribute-fileno](https://stackoverflow.com/questions/31488688/attributeerror-str-object-has-no-attribute-fileno)
