DDNS
DDNS copied to clipboard
增加指定网卡功能
导入了一个netifaces库
谢谢修改,两个问题
- 这个与
数字(0,1,2,3等): 第 i 个网卡 ip
这个功能是否有区别? - 尽量避免引入库外部依赖,尽量简单,保证有python的环境即可执行。
谢谢修改,两个问题
1. 这个与`数字(0,1,2,3等): 第 i 个网卡 ip`这个功能是否有区别? 2. 尽量避免引入库外部依赖,尽量简单,保证有python的环境即可执行。
数字0,1,2,3这个返回的是从/etc/hostname里读取的IP。不是真正的从网卡读取IP
然后第二个问题的话我也没想到特别好的方法。好像这种读取系统硬件信息的方法都是要引入别的包。
I don't think specifying the count of net interfaces is a good idea. Sometimes it would be annoying if new interfaces are added, causing the number changed
I think adding a library could be acceptable. Because getting interface address in system way is better than parsing the command line output.