This repository was archived by the owner on Sep 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproxy.py
More file actions
60 lines (52 loc) · 1.71 KB
/
pyproxy.py
File metadata and controls
60 lines (52 loc) · 1.71 KB
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
import sys
import os
while True:
print(sys.argv)
exitIM = False
with open(sys.argv[1], 'r') as r:
split1 = r.read().split("!--_--~")
print(len(split1))
if len(split1) > 3:
print("PYPROXY ERROR: Too many split tags")
input()
sys.exit()
elif len(split1) == 2:
print("PYPROXY ERROR: No ending split tag")
input()
sys.exit()
elif len(split1) == 1:
pass
else:
modules = split1[1].split("\n")
print(modules)
modules.pop(0)
modules.pop(len(modules)-1)
if "SUBORDINATE" in modules:
exitIM = True
modules.remove("SUBORDINATE")
for module in modules:
try:
exec(f"import {module}")
except ImportError:
os.system(f"py -m pip install {module}")
os.system(f'py "{sys.argv[1]}"')
if exitIM:
print("Exited Immediately")
sys.exit()
else:
print("Exited. Would you like to restart the program? (Y/N)")
command = input("- ")
if "COMMAND" in command:
commandS = command.split(" ")
if len(commandS) <= 2:
pass
else:
if commandS[1] == "start":
os.system(f'py "{{ PATH TO PROGRAM MANAGER }}" {commandS[2]}')
sys.exit()
elif command in ("Y", "y", "yes", "restart"):
continue
else:
input("You can now close this window")
sys.exit()
break