Python子流程不与OpenVPN合作
我正在尝试使用子过程连接到OpenVPN。当我将其直接输入终端时,该命令正常工作,但是由于某种原因,它在子过程命令中不起作用。
代码:
import subprocess
# use shell command to connect openvpn
r = subprocess.Popen(['openvpn', '--config', 'config.ovpn'], shell=True)
它返回OpenVPN的通用响应,例如:
General Options:
--config file : Read configuration options from file.
--help : Show options.
--version : Show copyright and version information.
... 100 more lines of help info
它似乎没有添加配置选项。
知道为什么吗?
I'm trying to use a subprocess to connect to openvpn. The command works fine when I enter it directly into the terminal, however, it does not work inside a subprocess command for some reason.
Code:
import subprocess
# use shell command to connect openvpn
r = subprocess.Popen(['openvpn', '--config', 'config.ovpn'], shell=True)
Which returns a generic response from openvpn like:
General Options:
--config file : Read configuration options from file.
--help : Show options.
--version : Show copyright and version information.
... 100 more lines of help info
It doesn't seem to be adding the config options.
Any idea why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论