Skip to main content

Store the python return value of commands for the session.

Project description

Store the python return value of commands for the session.

If you like the idea click ⭐ on the repo and tweet.

Installation

To install use pip:

xpip install xontrib-pyrtn
# or: xpip install -U git+https://github.com/dyuri/xontrib-pyrtn

Usage

xontrib load xontrib_pyrtn

The xontrib adds two functions to the global namespace - In() and Out(). They are similar to ipython's In[] and Out[]. (I'm using functions instead of lists to protect the history from accidental modifications.)

A new PROMPT_FIELD pyhistnum is also added, to be able to include the number of the upcoming command (like in ipython).

Example

$ xontrib load pyrtn
$ $PROMPT = "[{pyhistnum}]$ "
[2]$ [12 * 3 + 6]
[42]
[3]$ In(2)
"[12 * 3 + 6]\n"
[4]$ Out(2) + [1]
[42, 1]
[5]$ 

Credits

This package was created with xontrib cookiecutter template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xontrib-pyrtn-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file xontrib-pyrtn-0.1.0.tar.gz.

File metadata

  • Download URL: xontrib-pyrtn-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.6

File hashes

Hashes for xontrib-pyrtn-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d4bcbe550f180db13fc9d0c86c12ca00c664593c5f90cd0d467b25f8b9df80a1
MD5 7f8e9d6eae9bf220aa856706ec9e52c7
BLAKE2b-256 9e9b74c575294a5f0806821e101a6105439d297581811c946d50e521ee4a244a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page