os.popen("ifconfig | grep -Po '^\w+'").read().split()
import os map(lambda x:x.strip(':'),os.popen("ifconfig | grep -Po '^[^ ]+'").read().strip().split('\n'))
引用 3 楼 xpresslink 的回复:os.popen('ifconfig').read().split(' ', 1)大哥 不懂就不要回 语法编译都不过
os.popen('ifconfig').read().split(' ', 1)
37,719
社区成员
34,239
社区内容
加载中
试试用AI创作助手写篇文章吧