diff --git a/.gitignore b/.gitignore index 5a560a4..4311f65 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ \__pycache__ -\pakk.conf \ No newline at end of file +pakk.conf \ No newline at end of file diff --git a/Docs.md b/Docs.md new file mode 100644 index 0000000..6646aed --- /dev/null +++ b/Docs.md @@ -0,0 +1,26 @@ +# Docs + +## Installing a package + +## Creating a package + +Once the package is installed, you can use the commands in it, here is how to make one. + +The top of the file must look like this; + +```python +#["name", "package.", ["commands, command"]] +# made by +``` + +then, to write a command, just write a function with the code you want to run, take this for example; + +```python +#["echo", "package.echo", ["out"]] +# made by OusmBlueNinja + +def out(message): + print(message) +``` + +From here you can run pretty much anything. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/packages/pip.py b/packages/pip.py index dad2025..4b4d12b 100644 --- a/packages/pip.py +++ b/packages/pip.py @@ -2,7 +2,6 @@ # Made By Blurple import os, sys - def pip(command: list): print(command, len(command)) @@ -18,6 +17,4 @@ def pip(command: list): os.system(f"pip install {package}") except: - print("cannot download") - -# im trying to make a pip command so i can install from in the app \ No newline at end of file + print("cannot download") \ No newline at end of file diff --git a/packages/update.py b/packages/update.py new file mode 100644 index 0000000..5c851a6 --- /dev/null +++ b/packages/update.py @@ -0,0 +1,22 @@ +# -*- 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") \ No newline at end of file