|
18 | 18 | print('''
|
19 | 19 | █▀▀█ ▀█▀ █▀▀█ █ █ ▀█▀ █▀▀▀█ █▀▀█ █▀▀█ █▀▀▄
|
20 | 20 | █▄▄█ █ █▄▄█ █ █ █ █ ▄▄▄▀▀ █▄▄█ █▄▄▀ █ █
|
21 |
| - █ ▄█▄ █ █▄▀▄█ ▄█▄ █▄▄▄█ █ █ █ █ █▄▄▀ v1.5.1''') |
| 21 | + █ ▄█▄ █ █▄▀▄█ ▄█▄ █▄▄▄█ █ █ █ █ █▄▄▀ v1.5.2''') |
22 | 22 | print(Fore.YELLOW + " PYTHON PACKAGE MANAGER")
|
23 | 23 | print('''
|
24 | 24 | (1) Install package
|
|
85 | 85 | try:
|
86 | 86 | subprocess.check_call(["pip", "uninstall", uninstall_pkg])
|
87 | 87 | print(" " + Fore.BLACK + Back.RED + f" Uninstalled {uninstall_pkg} ")
|
88 |
| - print() |
89 |
| - #input(" Press Enter to exit...") |
90 | 88 | except subprocess.CalledProcessError:
|
91 | 89 | print(" " + Fore.BLACK + Back.RED + " PACKAGE NOT FOUND ")
|
92 | 90 | #input(" Press Enter to exit...")
|
93 | 91 | #break
|
94 | 92 |
|
95 | 93 | elif option == "5":
|
96 |
| - print() |
97 |
| - print(Fore.YELLOW + " NOTE: Input package names in the requirements file." + Style.RESET_ALL) |
98 |
| - print(Fore.RED + " Batch uninstalling packages..." + Style.RESET_ALL) |
99 |
| - print() |
| 94 | + confirm = input(Fore.LIGHTRED_EX + " Do you want to proceed? (Y/N): ") |
| 95 | + if confirm == "y".lower(): |
| 96 | + print() |
| 97 | + print(Fore.YELLOW + " NOTE: Input package names in the requirements file." + Style.RESET_ALL) |
| 98 | + print(Fore.RED + " Batch uninstalling packages..." + Style.RESET_ALL) |
| 99 | + print() |
100 | 100 |
|
101 |
| - with open("requirements.txt") as f: |
102 |
| - reqs = f.read().splitlines() |
103 |
| - for pkg in reqs: |
104 |
| - try: |
105 |
| - subprocess.check_call(["pip", "uninstall", "-y", pkg]) |
106 |
| - print(" " + Fore.BLACK + Back.RED + f" Uinstalled {pkg} ") |
107 |
| - except subprocess.CalledProcessError: |
108 |
| - print(" " + Fore.BLACK + Back.RED + " PACKAGE NOT FOUND ") |
| 101 | + with open("requirements.txt") as f: |
| 102 | + reqs = f.read().splitlines() |
| 103 | + for pkg in reqs: |
| 104 | + try: |
| 105 | + subprocess.check_call(["pip", "uninstall", "-y", pkg]) |
| 106 | + print(" " + Fore.BLACK + Back.RED + f" Uinstalled {pkg} ") |
| 107 | + except subprocess.CalledProcessError: |
| 108 | + print(" " + Fore.BLACK + Back.RED + " PACKAGE NOT FOUND ") |
| 109 | + else: |
| 110 | + print(" " + Fore.BLACK + Back.RED + " UNISTALLATION CANCELLED ") |
109 | 111 |
|
110 | 112 | elif option == "6":
|
111 | 113 | print()
|
|
162 | 164 |
|
163 | 165 |
|
164 | 166 |
|
165 |
| -# Copyright © 2023 Ashfaaq Rifath - PipWizard v1.5.1 |
| 167 | +# Copyright © 2023 Ashfaaq Rifath - PipWizard v1.5.2 |
0 commit comments