-
Notifications
You must be signed in to change notification settings - Fork 0
/
RunThisFirstMac.py
31 lines (31 loc) · 1009 Bytes
/
RunThisFirstMac.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#This is the registering part of the Flashcards program
#This program checks for a license code
import os
import sys
directory = os.path.sep.join(sys.argv[0].split(os.path.sep)[:-1])
#license code
license = 'afhui3y7123u8aef127389qweiuhfdsiuh284huidasfhui'
#Checks the file for the license code
f = open(directory+'/sites/license1.txt','r')
c = f.read()
c = c.split('n')
#Removes originial zip file used to send the code
file_path = directory+'/programtest.zip'
if os.path.isfile(file_path):
os.remove(file_path)
else:
pass
#Matches license
if license == c[0]:
print('Welcome. We are setting up.')
#Creates directory.txt which stores user directory and use times
x = open(directory+'/sites/license.txt','w')
d = open(directory+'/sites/directory.txt','w')
d.write(directory)
d.write('\n0')
print('Setup Complete')
else:
#if the license is invalid, the program will exit
print('INVALID LICENSE')
input('Press Enter to Exit')
exit()