生成mac地址
pymacgen的Python项目详细描述
生成mac地址
如何
…安装
# from pypi pip3 install pymacgen # from github pip3 install git+https://github.com/smthnspcl/pymacgen # if this repo has been cloned pip3 install .
…从cli使用
^{pr2}$
{EH8$使用代码
frompymacgenimportMACGenerator# these do not need instantiation of the MACGenerator classprint(MACGenerator.by_mac(str("EA:7B:EE:FB:01:42")))print(MACGenerator.by_prefix("42:06:66"))# these utilize the pyoui library, so instantiation of the MACGenerator class is neededm=MACGenerator("/tmp/oui.txt",True)# by company name examplesprint(m.by_organization("national security agency"))print(m.by_organization("samsung"))# by country name examplesprint(m.by_country_code("DE"))print(m.by_country_code("CN"))# by country code examplesprint(m.by_country_name("Germany"))print(m.by_country_name("China"))
- 项目
标签: