Make custom terminal commands in python.
Project description
TermCmds module
Make custom terminal commands in python.
how to make a basic command
example.py:
import TermCmds
cmd = TermCmds.Command()
@cmd.main_command
def main(args, kwargs, options):
print(args)
print(kwargs)
print(options)
@cmd.command("subcommand")
def subcommand(args, kwargs, options):
print("subcommand")
print(args)
print(kwargs)
print(options)
if __name__ == "__main__":
cmd.run()
python example.py a b -k v --o outputs:
["a", "b"]
{"k": "v"}
["o"]
python example.py subcommand c d -key value --option outputs:
subcommand
["c", "d"]
{"key": "value"}
["option"]
documentation
TermCmds.Command() is the class for the command
@cmd.main_command is the main command for .. args kwars options
@cmd.command(name) is the function link for .. name args kwargs options
args is a list of values that are not kwargs or options
kwargs is a dictionary of keys and values -key value
options is a list of options --option
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file TermCmds-0.0.3.tar.gz.
File metadata
- Download URL: TermCmds-0.0.3.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.1.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98b58118085993e961b50d4ce114f4e517d6fa7f66c0a735b66fce91a240ddd0
|
|
| MD5 |
60b2c0c55de15e961009ee41d8b101a3
|
|
| BLAKE2b-256 |
d0cbaca420da1831e14703a33db329d4daf593830eba88d79031a265ad2704a7
|
File details
Details for the file TermCmds-0.0.3-py3-none-any.whl.
File metadata
- Download URL: TermCmds-0.0.3-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.1.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2821988a0ff442bf61dc45c846885e11afaf48a7611ad82c8dab873232b5ee97
|
|
| MD5 |
04c04174c3e73d85822e52530ddbabf2
|
|
| BLAKE2b-256 |
b2a7aa382a41fe408a0dfd1d3525967feb3999549b02232d325ca8daeeb5cf70
|