-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.py
25 lines (24 loc) · 926 Bytes
/
install.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
import os
import platform
import getpass
import time
import webbrowser
if platform.system() == "Windows":
os.system("pip install flask")
os.system("pip install matplotlib")
cwd = os.getcwd()
main_path = os.path.abspath("main.py")
os.chdir(r"C:\Users\{}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup".format(getpass.getuser()))
with open("blood_pressure_manager.bat", "w") as f:
f.write("python3 \"" + main_path + "\"")
webbrowser.open("http://localhost:7634/")
os.chdir(cwd)
os.system("python3 \"" + main_path + "\"")
elif platform.system() == "Darwin":
os.system("sudo pip3 install flask")
os.system("sudo pip3 install matplotlib")
print("---------------------\n\nInstallation done! Please run main.py for the app.\n\n---------------------")
time.sleep(5)
else:
print("Operating system not supported!")
time.sleep(5)