Skip to content

Commit abe9dee

Browse files
Update pipwizard.py
1 parent 626079d commit abe9dee

File tree

1 file changed

+34
-12
lines changed

1 file changed

+34
-12
lines changed

pipwizard.py

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,53 @@
11
import importlib
2+
import os
23
import subprocess
4+
subprocess.check_call(["pip", "install", "colorama"])
5+
import colorama
6+
from colorama import Fore, Back, Style
7+
colorama.init(autoreset=True)
38

9+
os.system("cls")
10+
print()
11+
print(" " + Fore.BLACK + Back.YELLOW + " PIPWIZARD - Package Installer ")
12+
print(Fore.LIGHTBLACK_EX + " Copyright © 2023 Ashfaaq Rifath - PipWizard v1.2.0")
413
print('''
5-
(1) Install library
6-
(2) Upgrade library
7-
(3) Uninstall library''')
8-
option = input("Enter opton: ")
14+
(1) Install library
15+
(2) Upgrade library
16+
(3) Uninstall library''')
17+
option = input(Fore.CYAN + " Enter option: " + Style.RESET_ALL)
918

1019
if option == "1":
1120
print()
12-
install_lib = input("Enter library name: ")
13-
21+
install_lib = input(Fore.CYAN + " Enter library name: " + Style.RESET_ALL)
1422
try:
1523
importlib.import_module(install_lib)
16-
print(f"{install_lib} is already installed")
24+
print(" " + Fore.BLACK + Back.GREEN + f" {install_lib} already installed ")
25+
print()
26+
input("Press Enter to exit...")
1727
except ImportError:
1828
subprocess.check_call(["pip", "install", install_lib])
19-
print(f"{install_lib} had been installed.")
29+
print(" " + Fore.BLACK + Back.GREEN + f" {install_lib} has been installed ")
30+
print()
31+
input("Press Enter to exit...")
2032

2133
elif option == "2":
22-
upgrade_lib = input("Enter library name: ")
34+
print()
35+
upgrade_lib = input(Fore.YELLOW + " Enter library name: " + Style.RESET_ALL)
2336

2437
subprocess.check_call(["pip", "install", "--upgrade", upgrade_lib])
25-
print(f"{upgrade_lib} has been upgraded.")
38+
print(" " + Fore.BLACK + Back.GREEN + f" {upgrade_lib} has been upgraded ")
39+
print()
40+
input("Press Enter to exit...")
2641

2742
elif option == "3":
28-
uninstall_lib = input("Enter library name: ")
43+
print()
44+
uninstall_lib = input(Fore.LIGHTRED_EX + " Enter library name: " + Style.RESET_ALL)
2945

3046
subprocess.check_call(["pip", "uninstall", uninstall_lib])
31-
print(f"{uninstall_lib} had been uninstalled.")
47+
print(" " + Fore.BLACK + Back.RED + f"{uninstall_lib} has been uninstalled ")
48+
print()
49+
input("Press Enter to exit...")
50+
else:
51+
print(" " + Fore.BLACK + Back.RED + " INVALID OPTION ")
52+
print()
53+
input("Press Enter to exit...")

0 commit comments

Comments
 (0)