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.3.0.tar.gz
(2.6 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.3.0.tar.gz.
File metadata
- Download URL: quickshell-1.3.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4dc6a12952da161692307f23450c22204f8c2c74891685c9792abb9f3c2ec929
|
|
| MD5 |
5e69774a6d8dc9351b360626c2a7d567
|
|
| BLAKE2b-256 |
cf218dc8d21d298777757a0fb30bfabfd19ad387f3c4b40e9a9bcd9214ddde7f
|
File details
Details for the file quickshell-1.3.0-py3-none-any.whl.
File metadata
- Download URL: quickshell-1.3.0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5331320ebdb73fe3e6a441d7b57d57cf1c7c8d2397ee9100ac400321412c19e1
|
|
| MD5 |
6aed3354b4e0c0dd07ec37e46b6e3637
|
|
| BLAKE2b-256 |
310121961aa54c7c75f8926da75cc7e50812818825936fc979d623027d6b3135
|