TermPY/packages/update.py
The Color Blurple ad79a919db readme docs
2023-08-26 22:52:17 -04:00

22 lines
513 B
Python

# -*- coding: utf-8 -*-
#["pip", "packages.pip", ["pip"]]
# Made By Blurple
import os, sys
def pip(command: list):
print(command, len(command))
if len(command) != 1:
print("comand requires [ package_name ] [ args (optional) ] ")
return
package = command[0]
try:
from pip._internal import main as pipmain
pipmain(['install', {package}])
except ImportError:
os.system(f"pip install {package}")
except:
print("cannot download")