-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathstart.py
65 lines (53 loc) · 1.57 KB
/
start.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
try:
import sys
import webview
import importlib
import io,urllib.request
from zipfile import ZipFile
from importlib import util
import requests
import os
import time
import base64
import json
import configparser
import pyautogui
import win32api
import logging
import shutil
import base64
from PIL import Image
import io
import numpy as np
import win32gui
import win32ui
import win32con
import ctypes
import clipboard
except:
print('import error')
try:
import subprocess
except:
print('import error1')
try:
#pyupdater
from pyupdater.client import Client
from urllib.request import Request
except:
print('import error2')
#Dual load file. if no script name was sent it will run /apps/hub/hub.py else it will run the python file sent. (this allow the hub to run open source Raw python files while using the same ENV)
if len(sys.argv) > 1:
spec = util.spec_from_file_location('', os.getcwd()+'/apps/'+sys.argv[1]+'/'+sys.argv[1]+'.py')
module = util.module_from_spec(spec)
sys.path.append(os.getcwd()+'\\apps\\'+sys.argv[1])
os.chdir(r"apps/"+sys.argv[1])
# sys.path.append(os.getcwd()+'\\apps\\'+sys.argv[1]+'\\eggman')
# sys.path.append('apps/'+sys.argv[1])
spec.loader.exec_module(module)
else:
spec = util.spec_from_file_location('', os.getcwd()+'/apps/hub/hub.py')
module = util.module_from_spec(spec)
sys.path.append(os.getcwd()+'\\apps\\hub')
# sys.path.append('apps/hub')
spec.loader.exec_module(module)