1 Star 0 Fork 0

MengXiaodong/NetworkDev

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
Mac-format.py 438 Bytes
Copy Edit Raw Blame History
M-Xiaodong authored 2022-02-18 10:22 . Add files via upload
def mac_list():
with open('mac_list.txt', 'r',encoding='utf-8') as macs:
for mac in macs:
if '.' in mac or '-' in mac or ':' in mac:
mac1 = mac.strip().replace(":", "") # 加.lower()变全小写
mac_out = "-".join(mac1[i:i + 4] for i in range(0, len(mac1), 4))
print(mac_out)
else:
print('mac地址输入错误!!!')
mac_list()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/M-Xiaodong/NetworkDev.git
git@gitee.com:M-Xiaodong/NetworkDev.git
M-Xiaodong
NetworkDev
NetworkDev
main

Search