1 Star 0 Fork 0

unite小伟 / pythontest

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
subprocess_py.py 374 Bytes
一键复制 编辑 原始数据 按行查看 历史
unite小伟 提交于 2018-02-26 14:02 . test python
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
"""
@author:shengwei
@file:subprocess_py.py
@time:2018/2/23 002316:42
"""
import subprocess
print('$ nslookup')
p = subprocess.Popen(['nslookup'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, err = p.communicate(b'set q=mx\npython.org\nexit\n')
print(output)
print('Exit code:', p.returncode)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/unite/pythontest.git
git@gitee.com:unite/pythontest.git
unite
pythontest
pythontest
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891