<commit_before>=============================
lonetwin's pimped-up pythonrc
=============================

What is this ?
==============

This is a python script intended to improve on the default Python interactive
shell experience.

Unlike ipython_, bpython_ or any of the many other options out there, this is
not designed to be used as a separate interactive environment. The intent is to
keep it as a single file and use it as any other rcfile. This script relies
solely on the standard python library and will always remain that way.

Demo
=====
|demo|

Usage
=====

The `pythonrc` file will be executed when the Python interactive shell is
started, if `$PYTHONSTARTUP` is in your environment and points to the file.

You could also simply make the file executable and call it directly.

Additionally, this file will in turn, execute a virtual env specific rc file [#]_
if it exists, for the current session, enabling you to *pre-populate* sessions
specific to virtual environments.

Features
========

The file creates an InteractiveConsole_ instance and executes it. This instance
provides:

* execution history
* colored prompts and pretty printing
* auto-indentation
* intelligent tab completion [#]_

    - without preceding text four spaces
    - with preceding text

        + names in the current namespace
        + for objects, their attributes/methods
        + for strings with a `/`, pathname completion
        + module name completion in an import statement

* edit the session or a file in your `$EDITOR` (the ``\e`` command)

    - without no arguments, opens your `$EDITOR` with the session history
    - with filename argument, opens the file in your `$EDITOR`
    - with object as an argument, opens the source code for the object in `$EDITOR`

* list the source code for objects when available (the ``\l`` command)
* temporary escape to `$SHELL` or ability to execute a shell command and
  capturing the output in to the `_` variable (the ``!`` command)
* convenient printing of doc stings (the ``?`` command) and search for entries in
  online docs (the ``??`` command)
* auto-execution of a virtual env specific (`.venv_rc.py`) file at startup

If you have any other good ideas please feel free to submit pull requests or issues.


Configuration
=============

The code attempts to be easy to read and modify to suit personal preferences as
easily as possible. You can change any of the `commands` or the options like the
path to the history file, its size etc in the config dict at the top of the rc<commit_msg>Finally proper list rendering in github.<commit_after>=============================
lonetwin's pimped-up pythonrc
=============================

What is this ?
==============

This is a python script intended to improve on the default Python interactive
shell experience.

Unlike ipython_, bpython_ or any of the many other options out there, this is
not designed to be used as a separate interactive environment. The intent is to
keep it as a single file and use it as any other rcfile. This script relies
solely on the standard python library and will always remain that way.

Demo
=====
|demo|

Usage
=====

The `pythonrc` file will be executed when the Python interactive shell is
started, if `$PYTHONSTARTUP` is in your environment and points to the file.

You could also simply make the file executable and call it directly.

Additionally, this file will in turn, execute a virtual env specific rc file [#]_
if it exists, for the current session, enabling you to *pre-populate* sessions
specific to virtual environments.

Features
========

The file creates an InteractiveConsole_ instance and executes it. This instance
provides:

  * execution history
  * colored prompts and pretty printing
  * auto-indentation
  * intelligent tab completion [#]_
  
    - without preceding text four spaces
    - with preceding text
  
      + names in the current namespace
      + for objects, their attributes/methods
      + for strings with a `/`, pathname completion
      + module name completion in an import statement

  * edit the session or a file in your `$EDITOR` (the ``\e`` command)

    - without no arguments, opens your `$EDITOR` with the session hstory
    - with filename argument, opens the file in your `$EDITOR`
    - with object as an argument, opens the source code for the object in `$EDITOR`

  * list the source code for objects when available (the ``\l`` command)
  * temporary escape to `$SHELL` or ability to execute a shell command and
    capturing the output in to the `_` variable (the ``!`` command)
  * convenient printing of doc stings (the ``?`` command) and search for entries in
    online docs (the ``??`` command)
  * auto-execution of a virtual env specific (`.venv_rc.py`) file at startup

If you have any other good ideas please feel free to submit pull requests or issues.


Configuration
=============

The code attempts to be easy to read and modify to suit personal preferences as
easily as possible. You can change any of the `commands` or the options like the
path to the history file, its size etc in the config dict at the top of the rc
{'fraction_non_alphanumeric': 0.09153005464480875, 'fraction_numerical': 0.0, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1583429', 'n_tokens_mistral': 1308, 'n_tokens_neox': 1246, 'n_words': 740}