[英]Is there any python package that could configure IP address of network interface?
I am writing a server application which allow remote client to show/add/change/delete IP addresses of network interfaces of the machine where the host is running. 我正在编写一个服务器应用程序,允许远程客户端显示/添加/更改/删除运行主机的机器的网络接口的IP地址。
The OS is Linux(CentOS 5.2), so I could do that by simply parse and edit configure file. 操作系统是Linux(CentOS 5.2),所以我可以通过简单地解析和编辑配置文件来实现。 But is there any package that could simplify the job? 但是有没有可以简化工作的软件包?
And if there is none such package, if I open source my implementation, will that help other people? 如果没有这样的包,如果我开源我的实现,那会帮助其他人吗?
It looks like the open source project confparse should be able to easily do what you're looking for. 看起来开源项目confparse应该能够轻松地完成你正在寻找的东西。 In fact, one of their examples is parsing and modifying /etc/sysconfig/network-scripts/ifcfg-eth0
with ease. 事实上,他们的一个例子是轻松地解析和修改/etc/sysconfig/network-scripts/ifcfg-eth0
。
If you find this isn't what you need, I say that any efforts towards open sourcing software will inevitably help other people at some point, given that it is actually useful. 如果您发现这不是您所需要的,我说任何开源软件的努力都会在某些时候帮助其他人,因为它实际上是有用的。 ;) ;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.