跨平台、支持 Web 通信的 Python 终端工具
Project description
DecPython
Run Python in a subprocess from your code and get string results, or open a Jupyter-style web terminal. Cross-platform, stdlib only.
Install
pip install -e .
Quick start
from decpython import DecPython
dp = DecPython(gui=False, python='python')
result = dp.send('a = 1\nb = 2\na + b') # -> '3'
dp.close()
With a web UI: use gui=True and optionally python='python3.12'. Code and results from send() appear in the browser. Press Shift+Enter or click Run in the page.
API
send(code)— Run code; returns the last expression as a string (or the error message).close()— Stop the subprocess and, if used, the web server.
License
MIT
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 decpython-0.1.0.tar.gz.
File metadata
- Download URL: decpython-0.1.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea2722899455c0fc0064ad09a6cecc888dd712377c0afc3c2e5b28bd5bf5eca0
|
|
| MD5 |
c737a152ea18d71f8968f0f350dc4d11
|
|
| BLAKE2b-256 |
a1948c0b611ba796c2a314aa04af89f262b5f2328e9746403e96070a01cd496d
|
File details
Details for the file decpython-0.1.0-py3-none-any.whl.
File metadata
- Download URL: decpython-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3573148a356eaf02c0403d2a86be87835f5791994a31c180591c619763876c46
|
|
| MD5 |
8af170999a0ddbf4edc6e279bf6dea7a
|
|
| BLAKE2b-256 |
5bfb4caab6c6f24481b39923a2815c32b89d3eaaf2523b36d86c6f8ab697a876
|