-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
77 lines (56 loc) · 1.77 KB
/
main.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import os
import subprocess
import time
origin_path = ''
# change origin path to the path wich you have stored your locker
# use this format "C:\\Users\\You"
password = "enter your password"
def lock():
"""Locks the folder"""
print('you are locking')
subprocess.run('ren Locker "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"', shell=True)
subprocess.run('attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"', shell=True)
def unlock():
"""Unlocks the folder"""
print("you are unlocking")
subprocess.run('attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"', shell=True)
subprocess.run('ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locker', shell=True)
def md():
"""Makes new directory if it doesn't already exists"""
os.mkdir("Locker")
print('New Locker has been made'
'\n;)')
def if_y():
unlock()
npath = origin_path
npath = os.path.realpath(npath)
os.startfile(npath)
time.sleep(0.2)
def main():
print("Welcome")
os.chdir(origin_path)
a = os.listdir()
if "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" in a:
Pword = input("enter password\n")
if Pword == password:
inputt = input("Do you want to open your directory now")
if inputt == "y":
if_y()
elif inputt == "yes":
if_y()
else:
unlock()
else:
print('wrong password')
time.sleep(0.2)
exit()
elif "Locker" in a:
lock()
time.sleep(0.2)
else:
md()
time.sleep(0.2)
# Use this
# pyinstaller -F -i <icon path> main.py
# ex -> pyinstaller -F -i Dir\file.ico main.py
main()