import urllib.request
import subprocess
import socket
import re
child=subprocess.Popen("ipconfig", shell=True, stdout = subprocess.PIPE)
out=child.communicate();#保存ipconfig中的所有信息
ipv6_pattern='(([a-f0-9]{1,4}:){7}[a-f0-9]{1,4})'
m=re.findall(ipv6_pattern,str(out));
address=m[1][0]
print(address)
最后
以上就是忧心火车最近收集整理的关于python获取ipv6地址的全部内容,更多相关python获取ipv6地址内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复