-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpip.py
More file actions
70 lines (58 loc) · 1.99 KB
/
pip.py
File metadata and controls
70 lines (58 loc) · 1.99 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
61
62
63
64
65
66
67
68
69
70
import os
import sys
import subprocess
import time
# Color codes
C = "\033[1;91m"
S = "\033[1;91m"
N = "\033[1;94m"
V = "\033[1;94m"
reset = "\033[0m"
n = "\033[38;2;0;135;215m"
v = "\033[38;2;0;0;95m"
grey = "\033[38;2;200;200;200m"
green = "\033[1;92m"
yellow = "\033[1;93m"
bold = "\033[1m"
url = "https://t.me/baddieprotecter"
def clear_screen():
"""Clear screen (works in Termux/Linux/Windows)"""
os.system('cls' if os.name == 'nt' else 'clear')
def install_packages():
print(f"{grey}Installing required Python packages. Please wait...\n")
print(f"{C} C{S} S{N} N{V} V{grey} {C} C{S} S{n} N{v} V\n")
pkgs = [
("cfonts", "cfonts"),
("pyfiglet", "pyfiglet"),
("rich", "rich")
]
for package, pip_name in pkgs:
try:
__import__(package)
print(f"{green}[+] {package} is already installed.")
except ImportError:
print(f"{yellow}[➤] Installing {package}...")
try:
subprocess.check_call([sys.executable, "-m", "pip", "install", pip_name])
print(f"{green}[+] {package} installed successfully.")
except subprocess.CalledProcessError:
print(f"{C}✖ Failed with sys.executable, retrying with pip...")
try:
subprocess.check_call(["pip", "install", pip_name])
print(f"{green}[+] {package} installed successfully.")
except subprocess.CalledProcessError as e2:
print(f"{C}✖ Could not install {package}. Error: {e2}")
def main():
clear_screen()
time.sleep(1)
print(f"{C} C{S} S{N} N{V} V{grey} {C} b{S} a{n} n{v} e")
print("-" * 60)
print(f"{green}[+] All packages processed successfully.")
print(f"{n}You can now run the script.")
print(f"{n}If you face any issues, contact us at {url}")
print(f"{n}Thank you for using my script.")
print("-" * 60)
print(reset)
if __name__ == "__main__":
install_packages()
main()