diff --git a/README.rst b/README.rst index 5a337214..cb9048ab 100644 --- a/README.rst +++ b/README.rst @@ -1,64 +1,85 @@ -ptpython: a better Python REPL -============================== +ptpython +======== -|Build Status| +*A better Python REPL* -.. image:: https://pypip.in/version/ptpython/badge.svg - :target: https://pypi.python.org/pypi/ptpython/ - :alt: Latest Version +:: + + pip install ptpython + +.. image :: https://github.com/jonathanslenders/ptpython/raw/master/docs/images/example1.png -``ptpython`` is an advanced Python REPL built on top of the `prompt_toolkit -`_ library. +|Build Status| -It works best on all Posix systems like Linux, BSD and OS X. But it should work -as well on Windows. It works on all Python versions from 2.6 up to 3.4. +Ptpython is an advanced Python REPL. It should work on all +Python versions from 2.6 up to 3.5 and work cross platform (Linux, +BSD and OS X, Window). Installation ************ -To install ``ptpython``, type: +To install it using pip: :: pip install ptpython +Start it by typing ``ptpython``. + -The REPL +Features ******** -Run ``ptpython`` to get an interactive Python prompt with syntax highlighting, -code completion, etc... +- Syntax highlighting. +- Multiline editing (the up arrow works) +- Autocompletion. +- Mouse support. [1] +- Support for color schemes. +- Support for `bracketed paste `_ [2]. +- Both Vi and Emacs key bindings. +- Support for double width (Chinese) characters. +- ... and many other stuff. -.. image :: https://github.com/jonathanslenders/ptpython/raw/master/docs/images/example1.png -By default, you will have Emacs key bindings, but if you prefer Vi bindings -(like in the above screenshot) then run ``ptpython --vi``. +[1] Disabled by default. (Enable in the menu.) -If you want to embed the REPL inside your application at one point, do: +[2] If the terminal supports it (most terminals do), this allows pasting +without going into paste mode. It will keep the indentation. -.. code:: python - from ptpython.repl import embed - embed(globals(), locals()) +More screenshots +**************** +The configuration menu: -Autocompletion -************** +.. image :: https://github.com/jonathanslenders/ptpython/raw/master/docs/images/ptpython-menu.png + +The history page and its help: -``Tab`` and ``shift+tab`` complete the input. -In Vi-mode, you can also use ``Ctrl+N`` and ``Ctrl+P``. +.. image :: https://github.com/jonathanslenders/ptpython/raw/master/docs/images/ptpython-history-help.png -There is even completion on file names inside strings: +Autocompletion: .. image :: https://github.com/jonathanslenders/ptpython/raw/master/docs/images/file-completion.png +Embedding the REPL +****************** + +Embedding the REPL in any Python application is easy: + +.. code:: python + + from ptpython.repl import embed + embed(globals(), locals()) + + Multiline editing ***************** -Usually, multi-line editing mode will automatically turn on when you press enter -after a colon, however you can always turn it on by pressing ``F7``. +Multi-line editing mode will automatically turn on when you press enter after a +colon. To execute the input in multi-line mode, you can either press ``Alt+Enter``, or ``Esc`` followed by ``Enter``. (If you want the first to work in the OS X @@ -128,10 +149,8 @@ There is an experimental PDB replacement: `ptpdb About Windows support ********************* -``prompt_toolkit`` works still a little better on systems like Linux and OS X -than on Windows, but it certainly is usable. One thing that still needs -attention is the colorscheme. Windows terminals don't support all colors, so we -have to create another colorscheme for Windows. +``prompt_toolkit`` and ``ptpython`` are better tested on Linux and OS X than on +Windows, but it should be usable: .. image :: https://github.com/jonathanslenders/ptpython/raw/master/docs/images/windows.png diff --git a/docs/images/example1.png b/docs/images/example1.png index 3c2047eb..c46b55a8 100644 Binary files a/docs/images/example1.png and b/docs/images/example1.png differ diff --git a/docs/images/file-completion.png b/docs/images/file-completion.png index 2fd72aec..3143293e 100644 Binary files a/docs/images/file-completion.png and b/docs/images/file-completion.png differ diff --git a/docs/images/multiline.png b/docs/images/multiline.png index c20e2fa2..cdfeb328 100644 Binary files a/docs/images/multiline.png and b/docs/images/multiline.png differ diff --git a/docs/images/ptpython-history-help.png b/docs/images/ptpython-history-help.png new file mode 100644 index 00000000..a52b5c2c Binary files /dev/null and b/docs/images/ptpython-history-help.png differ diff --git a/docs/images/ptpython-menu.png b/docs/images/ptpython-menu.png new file mode 100644 index 00000000..923ca12b Binary files /dev/null and b/docs/images/ptpython-menu.png differ diff --git a/docs/images/ptpython.png b/docs/images/ptpython.png new file mode 100644 index 00000000..c46b55a8 Binary files /dev/null and b/docs/images/ptpython.png differ