Skip to content

Instantly share code, notes, and snippets.

@MOOOWOOO
Created April 13, 2016 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MOOOWOOO/26e8c07becb6e4d40080b72267ef80ed to your computer and use it in GitHub Desktop.
Save MOOOWOOO/26e8c07becb6e4d40080b72267ef80ed to your computer and use it in GitHub Desktop.
获取MAC地址
# -*- coding:utf-8 -*-
from uuid import getnode as get_mac, UUID
macaddr=UUID(int=get_mac()).hex[-12:].upper() # FFFFFFFFFFFF
return(":".join([macaddr[e:e+2] for e in range(0,11,2)]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment