Change your REPL prompt.
Project description
ytho
Change Python's prompt with ease. Because >>>
is boring.
Installation
pip install ytho
Usage
Define a file .ytho.py
in your home directory, with a class Prompt
.
This will define your prompt. For example:
class Prompt:
def __init__(self):
self.counter = 0
def prompt(self) -> tuple[str, str]:
self.counter += 1
ps1 = f"\033[1;32mIn [{self.counter}] \033[m: "
# The ANSI codes take up 10 chars, remove those
ps2 = " " * (len(ps1) - 10)
return ps1, ps2
And now you have IPython's prompt. And you can do a lot more than that if you want!.
Local Development / Testing
- Create and activate a virtual environment
- Run
pip install -r requirements-dev.txt
to do an editable install - Run
pytest
to run tests
Type Checking
Run mypy .
Create and upload a package to PyPI
Make sure to bump the version in setup.cfg
.
Then run the following commands:
rm -rf build dist
python setup.py sdist bdist_wheel
Then upload it to PyPI using twine:
twine upload dist/*
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
ytho-0.1.0.tar.gz
(4.7 kB
view details)
Built Distribution
ytho-0.1.0-py3-none-any.whl
(4.6 kB
view details)
File details
Details for the file ytho-0.1.0.tar.gz
.
File metadata
- Download URL: ytho-0.1.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 476f0c716643c6189ba72c648bf93a83eba223c7cbe85dc01288cd59e34ac25f |
|
MD5 | e540d62efe667107f485e022db27f2d2 |
|
BLAKE2b-256 | 673c67f19e60e6118cc75d92cc50da4341478a125e9a829100e06bc98e2075f1 |
File details
Details for the file ytho-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: ytho-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 668f8cd3dcd00b455f317d734c60c79eee93ce074787c01dca64ec1e8a95a587 |
|
MD5 | 25c134e42a9623b5910210ca0cb7d1bd |
|
BLAKE2b-256 | 90e6f5b9b65a408807f956a341342a41cb94b6d6eeb2efce605c97725e4b9489 |