title: Log a mac address and check if its valid
body: <p>Hi im trying to make a script where if you run it the first time it logs your mac address then if you run it a second third etc time then it will just check if your mac address is the same and the one logged when you first ran it I couldn't really visualize how I was going to do it I did make some beginning code but it wasn't working how I wanted:</p>
  <pre><code>import time
  import sys
  import logging
  from uuid import getnode as get_mac
  import re
  
  logging.basicConfig(filename='mac.txt', filemode='w', format='%(name)s - %(levelname)s - %(message)s')
  mac = get_mac()
  logging.warning(mac)
  print(mac)
  
  logging.basicConfig(filename='log.txt', filemode='w', format='%(name)s - %(levelname)s - %(message)s')
  log = get_mac()
  logging.warning(log)
  print(log)
  sys.exit()
  
  if mac == log:
      print(&quot;True&quot;)
  
  else:
      print(&quot;False&quot;)
  </code></pre>
  <p>That was my beginning code it logs your mac address in mac.txt and logs your mac address a second time in log.txt then it asks if mac and log are the same and if they are true if not false but I couldn't find a way to log it every time on mac but only log once on log I am trying to achieve if you change to a different computer it would display false because your mac address in mac isn't the same in log but I wasn't sure how to turn my code in to something like that but as I said my mac and log both log every time defeating the point.</p>