|
1 | 1 | import importlib
|
| 2 | +import os |
2 | 3 | import subprocess
|
| 4 | +subprocess.check_call(["pip", "install", "colorama"]) |
| 5 | +import colorama |
| 6 | +from colorama import Fore, Back, Style |
| 7 | +colorama.init(autoreset=True) |
3 | 8 |
|
| 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") |
4 | 13 | 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) |
9 | 18 |
|
10 | 19 | if option == "1":
|
11 | 20 | print()
|
12 |
| - install_lib = input("Enter library name: ") |
13 |
| - |
| 21 | + install_lib = input(Fore.CYAN + " Enter library name: " + Style.RESET_ALL) |
14 | 22 | try:
|
15 | 23 | 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...") |
17 | 27 | except ImportError:
|
18 | 28 | 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...") |
20 | 32 |
|
21 | 33 | elif option == "2":
|
22 |
| - upgrade_lib = input("Enter library name: ") |
| 34 | + print() |
| 35 | + upgrade_lib = input(Fore.YELLOW + " Enter library name: " + Style.RESET_ALL) |
23 | 36 |
|
24 | 37 | 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...") |
26 | 41 |
|
27 | 42 | 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) |
29 | 45 |
|
30 | 46 | 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