0

I want to allow my python program only for specific computers. My idea was to allow starting the program only from a computer with a specific Mac-Address. Do you have an idea how can I do this?

This is working to get the Mac-Address from the user:

from uuid import getnode as get_mac
mac = get_mac()

So I could do something like this:

from uuid import getnode as get_mac

allowed_mac= 'The Mac-Adress which is allowed to start the program'
mac = get_mac()

if allowed_mac == mac:
    startProgram() #Does such a function exists?

Maybe I could to it in the main function but is that protection enough to prevent unallowed users to use the program?

Thanks!

marie1995
  • 59
  • 1
  • 3
  • 8
  • If you flipped it on it's head and said in the main if mac not in list_of_macs sys.exit() that would work. https://www.guru99.com/learn-python-main-function-with-examples-understand-main.html https://www.hashbangcode.com/article/stopping-code-execution-python – JGFMK Aug 14 '19 at 09:36
  • Thanks for your answer. But is that not a very low protection or is that already not bad to secure it? – marie1995 Aug 14 '19 at 11:05

0 Answers0