The important thing in life is to have a great aim , and the determination

          常用鏈接

          統計

          IT技術鏈接

          保險相關

          友情鏈接

          基金知識

          生活相關

          最新評論

          在python中獲取mac和ip地址

          python 獲得本機MAC地址:
          import uuid
               def get_mac_address():
               mac=uuid.UUID(int=uuid.getnode()).hex[-12:]
               return ":".join([mac[e:e+2] for e in range(0,11,2)])


          python獲取IP的方法:使用socket

          import socket

          myname=socket.getfqdn(socket.gethostname( ))
              myaddr=socket.gethostbyname(myname)
              print(myname)
              print(myaddr)

          posted on 2017-05-15 23:26 鴻雁 閱讀(252) 評論(0)  編輯  收藏 所屬分類: IT技術相關

          主站蜘蛛池模板: 山西省| 罗城| 米林县| 四子王旗| 射阳县| 沁源县| 平乐县| 阳春市| 寿宁县| 富民县| 南漳县| 台东市| 汕头市| 车致| 九龙坡区| 大方县| 年辖:市辖区| 信宜市| 萍乡市| 凤翔县| 碌曲县| 策勒县| 湟中县| 鹤山市| 七台河市| 新乡市| 万全县| 平罗县| 永宁县| 嘉祥县| 满洲里市| 巩留县| 桐庐县| 璧山县| 鄱阳县| 左贡县| 汽车| 宁化县| 纳雍县| 石景山区| 东丰县|