runp exports Python functions from files to the command line. You don’t need to change your existing code.
If you have a file named myfile.py with:
def foo():
"""beeps a lot"""
print "beep beep"
def bar(text):
"""Prints things
Args:
text (str): The text to print
"""
print text
And you want to run it in the command line just do:
$ runp myfile.py foo beep beep
You can also pass arguments to your functions:
$ runp myfile.py bar:"this is sweet!" this is sweet!
Functions with names starting with _ are hidden.
You can list available functions with:
$ runp myfile.py -l Available functions: foo beeps a lot bar Prints things
And get info on a specific function:
$ runp myfile.py -d bar
Displaying docstring for function bar in module myfile
bar(text)
Prints things
Args:
text (str): The text to print
Syntax for calling functions is:
$ runp myfile.py function_name:arg1value,arg2=arg2value
The concept, syntax for commands and initial code are heavily inspired by fabric’s task system.
Release files for pyrunp 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyrunp-0.0.3.tar.gz | 4.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyrunp-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.3 kB
Release files / pyrunp-0.0.3.tar.gz
| Download URL | pyrunp-0.0.3.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5fe128e1c13c12f06a6d9ec9cfcba97d0e1d0955420f38dd53c8ec51b5615505
|
|
BLAKE2b-256 checksum How to use checksums |
1cc7e5e8749d0fa0515a8de969b2a9ad2bf8e8a73e7c2f049ed51dd5b692d846
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pyrunp-0.0.3-py3-none-any.whl
| Download URL | pyrunp-0.0.3-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9fbbf170d133b9403d00ec2b0c934e1b18916a29bdde7a0d09f27c0ad7f30576
|
|
BLAKE2b-256 checksum How to use checksums |
92d2c497debf0100e5a3b14ce77ac28ee4988fcb3664b4f372740a1c0715e1bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|