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[]. (In() and Out() is also available and does the same thing, except they can be called w/o argument and will show the list of input/output.)

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.2.0.tar.gz (3.2 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: xontrib-pyrtn-0.2.0.tar.gz
  • Upload date:
  • Size: 3.2 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.2.0.tar.gz
Algorithm Hash digest
SHA256 a7d80bc3e971214c345299f148c354409f320c018c3ea0154a00a4ff1fa5e0fd
MD5 3fc0451b06720704763eabf4c2c43314
BLAKE2b-256 758e4283767345e3d3c8dd318c21a8eff530bf4ad9ff373e6e5e06fc0da9d1e0

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