You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
855 B
24 lines
855 B
import subprocess |
|
from importlib import util as importlibutil |
|
|
|
def module_exists(module_name): |
|
return importlibutil.find_spec(module_name) |
|
|
|
def gitclone(url, targetdir=None): |
|
if targetdir: |
|
res = subprocess.run(['git', 'clone', url, targetdir], stdout=subprocess.PIPE).stdout.decode('utf-8') |
|
else: |
|
res = subprocess.run(['git', 'clone', url], stdout=subprocess.PIPE).stdout.decode('utf-8') |
|
print(res) |
|
|
|
def pipi(modulestr): |
|
res = subprocess.run(['pip', 'install', modulestr], stdout=subprocess.PIPE).stdout.decode('utf-8') |
|
print(res) |
|
|
|
def pipie(modulestr): |
|
res = subprocess.run(['git', 'install', '-e', modulestr], stdout=subprocess.PIPE).stdout.decode('utf-8') |
|
print(res) |
|
|
|
def wget(url, outputdir): |
|
res = subprocess.run(['wget', url, '-P', f'{outputdir}'], stdout=subprocess.PIPE).stdout.decode('utf-8') |
|
print(res)
|
|
|