python:cmd管道
2022/8/25 1:24:26
本文主要是介绍python:cmd管道,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
commands = f"""ssh root@120.7x.254.99 -p2483 cd /data/wwwroot/csjs2_client_dev git pull ssh://git@172.16.x.161x:2483/data/repos/csjs2_client_dev.git """ import subprocess def subprocess_popen(commands,stdout=subprocess.PIPE, stderr=subprocess.STDOUT): current_process = subprocess.Popen(commands, stdout=stdout, stderr=stderr) standoutput, standerr = current_process.communicate() current_process.wait() current_process.kill() print(standoutput) return standoutput subprocess_popen(commands)
备注:commands写的时候第一行 一定要有 否则按照空行 会报错
这篇关于python:cmd管道的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-03-30开始python成长之路
- 2024-03-29python optparse
- 2024-03-29python map 函数
- 2024-03-20invalid format specifier python
- 2024-03-18pool.map python
- 2024-03-18threads in python
- 2024-03-14python Ai 应用开发基础训练,字符串,字典,文件
- 2024-03-13id3 algorithm python
- 2024-03-13sum array elements python
- 2024-03-12python colon equals