Skip to main content

A simple shell for Python.

Project description

INSTALL:

pip3 install python-shell

How to use:

Step 1:

First create a file containing python code(will be executed when given command is used). The file does not have to have a .py extension.

To add arguments to your command, do it like this:

args = REPLACEME

for demonstration purposes i will use this simple code:


args = REPLACEME

if(args[0] == "help"): print("This command prints whatever you want. Arguments: [text to print]") else: for text in args: print(text + " ", end="")


Step 2:

Create a new shell instance and add the command like this:


from python-shell import shell

cmdline = shell() cmdline.add_command("echo", "/home/kiki/myfirstpythonscript/cmd/echo")


Now, simply start the shell by adding this:

cmdline.start()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pythonsimpleshell-0.0.1.tar.gz (2.4 kB view hashes)

Uploaded Source

Built Distribution

pythonsimpleshell-0.0.1-py3-none-any.whl (2.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page