Skip to main content

pyCmdlineHistory

Shield: CC BY-SA 4.0

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

image1

Save command line history and provide a command line completer for python.

Original code is from ActiveState Code » Recipes 2006.06.29 by Sunjoong LEE. ActiveState content is published under CC BY-SA 3.0.

Usage

Insert the lines

import sys
import subprocess

try:
    import berhoel.cmd_line_history
except ImportError:
    # checking if python is running under virtualenv of venv
    is_venv = (
        # This handles PEP 405 compliant virtual environments.
        (sys.prefix != getattr(sys, "base_prefix", sys.prefix))
        or
        # This handles virtual environments created with pypa's virtualenv.
        hasattr(sys, "real_prefix")
    )

    subprocess.check_call(
        [sys.executable, "-m", "pip", "install"]
        + ([] if is_venv else ["--user"])
        + ["pyCmdlineHistory",]
    )

to “~/.pystartup” file, and set an environment variable to point to it:

export PYTHONSTARTUP=${HOME}/.pystartup

in bash.

This will locally install the module for each python you are calling.

Documentation

Documentation can be found here

References

  • Guido van Rossum. Python Tutorial. Python Software Foundation, 2005. 86

  • Jian Ding Chen. Indentable rlcompleter. Python Cookbook Recipe 496812

  • Guido van Rossum. rlcompleter.py. Python Software Foundation, 2005

2006.06.29 Sunjoong LEE sunjoong@gmail.com 2020 - 2023 Berthold Höllmann berhoel@gmail.com

Metadata

Release files for pyCmdlineHistory 1.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyCmdlineHistory 1.1.6
File Size Uploaded Provenance Actions
pycmdlinehistory-1.1.6.tar.gz 12.2 kB Without provenance Details for pycmdlinehistory-1.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyCmdlineHistory 1.1.6
File Interpreter ABI Platform Actions
pycmdlinehistory-1.1.6-py3-none-any.whl Python 3 none any Details for pycmdlinehistory-1.1.6-py3-none-any.whl

Total release size: 25.6 kB

Release files / pycmdlinehistory-1.1.6.tar.gz

Download URL pycmdlinehistory-1.1.6.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b24950a8875395be5deef7d5196f0541dbfef549ad3288c45bc5d9673b6959a5
BLAKE2b-256 checksum
How to use checksums
d69433ba1a9132eac242bf26ad875eaf0806c66a9be10cb5279ec30c0c8908f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.9 Linux/6.10.2-1-default

Release files / pycmdlinehistory-1.1.6-py3-none-any.whl

Download URL pycmdlinehistory-1.1.6-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a20feddec3a6732b7ba35ddded33a5c288a48f665ea8885db3d550b1621d0adf
BLAKE2b-256 checksum
How to use checksums
ec75bc32fb2ceacd4a7f1c8b4fa2a68568c2b0c556a9185e63c5f13821996693
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.9 Linux/6.10.2-1-default

Security for pyCmdlineHistory 1.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page