python调用shell脚本

[root@oracledb python3]# cat /home/b.sh
echo "hello"


>>> import subprocess
>>>
>>> subprocess.call('sh /home/b.sh', shell=True)
hello
0

posted @ 2018-11-19 11:07  effortsing  阅读(186)  评论(0)    收藏  举报