Removes the boilierplate when working with shells in python.
Project description
QuickShell: Simplify Shell Command Execution in Python
QuickShell is a simple Python library designed to remove the boilerplate when dealing with shell commands.
Key Features
- Asynchronous Execution: Run shell commands asynchronously using asyncio.
- Flexible Output Handling: Easily print and capture command output and errors.
Installation
Get started with QuickShell by installing it via pip:
pip install quickshell
Usage
use QuickShell to quickly run a command:
import asyncio
from quickshell import run_shell
async def main():
cmd = 'echo Hello from the shell!'
stdout, stderr = await run_shell(cmd, print_output=True) # Output: Hello from the shell!
if __name__ == '__main__':
asyncio.run(main())
Explanation
- Importing the Library: the
run_shellfunction is imported from thequickshelllibrary. - Define the Command: Replace
"dir"with the shell command you want to execute. - Running the Command: The
run_shellfunction executes the command asynchronously and captures its output. - Printing the Output: Set
print_output=Trueto print the live output and errors from the shell.
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
quickshell-1.0.1.tar.gz
(2.5 kB
view details)
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 quickshell-1.0.1.tar.gz.
File metadata
- Download URL: quickshell-1.0.1.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cf9cf79aa6b68247abe6f8dfaf823bc4544bacbfef87ca7f8f73aa6f9a8472f
|
|
| MD5 |
b86f244c9f546d8c0e93ac7c2b0d95fc
|
|
| BLAKE2b-256 |
5f984bd7a34b4003adc3c0386ac4de534737c38765aa042fc1799036172ddebb
|
File details
Details for the file quickshell-1.0.1-py3-none-any.whl.
File metadata
- Download URL: quickshell-1.0.1-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82f4982d353d1d385efc6f12e2fbad3128f841b5885f6e6936b74e34b361ead2
|
|
| MD5 |
4ea775ad91739381d7b7f187c67348e2
|
|
| BLAKE2b-256 |
aef2ad34e294816c9a0cb4566b78fe0f6a69969cbc4c4fb4bd258b6892f822a2
|