regex - Increase / Decrease Mac Address in Python from String -


i have mac address in string form. interested in taking mac string , increasing / decreasing 1 value while keeping integrity of hex in python

ex: 000000001f

-1: 000000001e +1: 0000000020

parse it, change it, print it!

def change_mac(mac, offset)     return "{:012x}".format(int(mac, 16) + offset) 

Comments

Popular posts from this blog

mod rewrite - Using "?" when rewriting the URL -

.htaccess: Transfer name to index.php if not directory public -

Admob integration with pygame in android -