-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetup.py
More file actions
33 lines (31 loc) · 859 Bytes
/
Setup.py
File metadata and controls
33 lines (31 loc) · 859 Bytes
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
import subprocess
import sys
import socket
def check_internet(host="8.8.8.8", port=53, timeout=3):
try:
# Attempt to connect to a well-known DNS server (Google)
socket.setdefaulttimeout(timeout)
with socket.create_connection((host, port)):
return True
except OSError:
return False
# List of required third-party packages
if check_internet():
required_packages = [
"tk-tools",
"customtkinter",
"pillow",
"realpass",
"urllib3",
"pysqlite3",
"random",
"cryptography",
"opencv-python",
"pyzbar",
"qrcode"
]
# Install each package using pip
for package in required_packages:
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
else:
print("Please Connect to the internet!")