bpython - A fancy curses interface to the Python interactive interpreter

Related tags

Interpreterbpython
Overview
https://img.shields.io/pypi/v/bpython https://readthedocs.org/projects/bpython/badge/?version=latest

bpython: A fancy curses interface to the Python interactive interpreter

bpython is a lightweight Python interpreter that adds several features common to IDEs. These features include syntax highlighting, expected parameter list, auto-indentation, and autocompletion. (See below for example usage).

bpython

bpython does not aim to be a complete IDE - the focus is on implementing a few ideas in a practical, useful, and lightweight manner.

bpython is a great replacement to any occasion where you would normally use the vanilla Python interpreter - testing out solutions to people's problems on IRC, quickly testing a method of doing something without creating a temporary file, etc..

You can find more about bpython - including full documentation - at our homepage.

Installation & Basic Usage

Installation using Pip

If you have pip installed, you can simply run:

$ pip install bpython

Start bpython by typing bpython in your terminal. You can exit bpython by using the exit() command or by pressing control-D like regular interactive Python.

Installation via OS Package Manager

The majority of operating system of desktop computers comes with a package manager system, if you are any user of them, you can install bpython using the package manager.

Ubuntu/Debian

Ubuntu/Debian family Linux users and install bpython using the apt package manager, using the command with sudo privilege:

$ apt install bpython

In case you are using an older version, run

$ apt-get install bpython
Arch Linux

Arch linux uses pacman as the default package manager, and you can use it to install bpython:

$ pacman -S bpython
Windows

Caveats: As bpython makes use of the ncurses library of *nix-family operating systems, bpython on Windows is not officially supported and tested.

However, you can still use bpython on Windows using a somewhat work around. Briefly, you should install these two packages using pip:

$ pip install bpython windows-curses

Then you should invoke a program called bpython-curses.exe instead of bpython.exe to use bpython:

$ bpython-curses
Mac OS

Like Windows, Mac OS does not include a package manager by default. If you have installed any third-party package manager like MacPorts, you can install it via

$ sudo port install py-bpython

Features & Examples

  • Readline-like autocomplete, with suggestions displayed as you type.
  • In-line syntax highlighting. This uses Pygments for lexing the code as you type, and colours appropriately.
  • Expected parameter list. As in a lot of modern IDEs, bpython will attempt to display a list of parameters for any function you call. The inspect module is tried first, which works with any Python function, and then pydoc if that fails.
  • Rewind. This isn't called "Undo" because it would be misleading, but "Rewind" is probably as bad. The idea is that the code entered is kept in memory and when the Rewind function is called, the last line is popped and the entire session is re-evaluated. Use <control-R> to rewind.
  • Edit the current line or your entire session in an editor. F7 opens the current session in a text editor, and if modifications are made, the session is rerun with these changes.
  • Pastebin code/write to file. Use the <F8> key to upload the screen's contents to pastebin, with a URL returned.
  • Reload imported Python modules. Use <F6> to clear sys.modules and rerun your session to test changes to code in a module you're working on.

Configuration

See the sample-config file for a list of available options. You should save your config file as ~/.config/bpython/config (i.e. $XDG_CONFIG_HOME/bpython/config) or specify at the command line:

bpython --config /path/to/bpython/config

Dependencies

  • Pygments
  • curtsies >= 0.3.5
  • greenlet
  • pyxdg
  • requests
  • Sphinx >= 1.5 (optional, for the documentation)
  • babel (optional, for internationalization)
  • jedi (optional, for experimental multiline completion)
  • watchdog (optional, for monitoring imported modules for changes)

bpython-urwid

bpython-urwid requires the following additional packages:

  • urwid

Known Bugs

For known bugs please see bpython's known issues and FAQ page.

Contact & Contributing

I hope you find it useful and please feel free to submit any bugs/patches suggestions to Robert or place them on the GitHub issues tracker.

For any other ways of communicating with bpython users and devs you can find us at the community page on the project homepage, or in the community.

Hope to see you there!

CLI Windows Support

Dependencies

Curses Use the appropriate version compiled by Christoph Gohlke.

pyreadline Use the version in the cheeseshop.

Recommended

Obtain the less program from GnuUtils. This makes the pager work as intended. It can be obtained from cygwin or GnuWin32 or msys

Current version is tested with

  • Curses 2.2
  • pyreadline 1.7

Curses Notes

The curses used has a bug where the colours are displayed incorrectly:

  • red is swapped with blue
  • cyan is swapped with yellow

To correct this I have provided a windows.theme file.

This curses implementation has 16 colors (dark and light versions of the colours)

Alternatives

ptpython

IPython

Feel free to get in touch if you know of any other alternatives that people may be interested to try.

Comments
  • Mac OS X: Mouse Scrolling triggers command history instead of scrolling the window

    Mac OS X: Mouse Scrolling triggers command history instead of scrolling the window

    Hi there,

    I have to say that this is a bit annoying, as bpython (the shell variant) is one of the very few applications that redefine scroll wheel events in this way.

    I am quite sure that this is a setting that can be changed - but the point of this bug report is that the default for that setting should really be to let the scroll wheel, well, scroll the window.

    Instead what happens is that I scroll through the history of the commands I have invoked previously. True, that can also be interesting, but I am already perfectly capable of doing that with the up down arrows on my keyboard, which I need to use anyway when I want to execute commands.

    So please change the default for the scroll wheel to actually scrolling the window.

    opened by dwt 31
  • Something about boto3 crashes bpython

    Something about boto3 crashes bpython

    I don't know enough to debug this further. I'm hoping someone can help because I really rely on bpython to explore and develop using libraries I don't know.

    Steps to reproduce:

    $ pip install boto3 # you don't even need a ~/.aws/credentials file
    $ bpython
    bpython version 0.16 on top of Python 2.7.12 /usr/local/opt/python/bin/python2.7
    >>> import boto3
    >>> s3=boto3.resource('s3')
    >>> obj=s3.Object('bucket','key') # this can literally be those 2 strings
    >>> obj.get(
    Traceback (most recent call last):
      File "/usr/local/bin/bpython", line 11, in <module>
        sys.exit(main())
      File "/usr/local/lib/python2.7/site-packages/bpython/curtsies.py", line 190, in main
        exit_value = repl.mainloop()
      File "/usr/local/lib/python2.7/site-packages/bpython/curtsies.py", line 125, in mainloop
        self.process_event_and_paint(e)
      File "/usr/local/lib/python2.7/site-packages/bpython/curtsies.py", line 99, in process_event_and_paint
        array, cursor_pos = self.paint()
      File "/usr/local/lib/python2.7/site-packages/bpython/curtsiesfrontend/repl.py", line 1447, in paint
        if self.matches_iter.completer else None)
      File "/usr/local/lib/python2.7/site-packages/bpython/curtsiesfrontend/replpainter.py", line 179, in paint_infobox
        if docstring else [])
      File "/usr/local/lib/python2.7/site-packages/bpython/curtsiesfrontend/replpainter.py", line 167, in formatted_docstring
        for line in docstring.split('\n')), [])
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2822: ordinal not in range(128)
    

    That crash happens as soon as you strike the ( key. You don't have to hit enter.

    opened by RichardBronosky 27
  • Home and End keys not working

    Home and End keys not working

    Also I should note that in the default curtsies frontend Home and End keys don't work in several different terminals (konsole, gnome-terminal, both use TERM=xterm) (C-a & C-e do)

    blocked 
    opened by thomasballinger 27
  • Brackets completion

    Brackets completion

    Solution for #905

    As requested, posted here for feedback (still needs polishing, more docs and tests).

    Changes include traditional IDEs behavior on completing brackets ( [ { and quotes " '. This works in writing, as well as with callable autocomplete matches.

    Example: If you type in def foo(, the line will print def foo() and put the cursor between the brackets. This also works with nested brackets and quotes. So if you do x = 5*(some_list[5]), the brackets will close upon writing the starting paren/quote, and put your cursor inside them.

    I also implemented behavior on BACKSPACE key and TAB key. If your cursor is currently positioned right on the character, which is a closing bracket or a quote and you hit TAB, your cursor will move behind that symbol. If you hit BACKSPACE and the first character to be deleted is an opening bracket, and your cursor is on a closing bracket, this will delete both brackets/quotes. This behavior also works in nested brackets environment.

    Feature can be enabled in config file by setting the brackets_completion flag to True.

    Thank you for the feedback.

    Still needs tests. Guidance or advice appreciated.

    opened by samuelgregorovic 21
  • Cannot show most source code

    Cannot show most source code

    Some examples:

       > def fnord(): pass
       > fnord<f2> # doesn't work
       > class Foo(object): pass
       > Foo<f2> # doesn't work
    

    Both of these work fine in iPython. Putting these two definitions in a file and importing them yields the same result - source does not show.

    These are reduced examples, in my testing I noticed that I could show the source of a whole class in my project, but I wasn't able to show most of the methods on it. Some examples: properties, decorated methods, inherited methods.

    Not sure whats the reason for this, but iPython did work for those most of the time, so it may be a good idea to fork their method source lookup code and use it instead of what is in bpython right now.

    bug 
    opened by dwt 21
  • Autocomplete for lists, tuples - autocomplete could work for items in lists, tuples, etc #37

    Autocomplete for lists, tuples - autocomplete could work for items in lists, tuples, etc #37

    This handles part of #37.

    It so far works with array indexing (lists and tuples). It was tested mainly for strings and objects. It does support nesting of arrays: a[0][0].

    I will later looking into supporting dictionaries, and possibly inline creation of data structures.

    opened by shawnaxsom 20
  • Ctrl-Y in OS X causes bpython to suspend

    Ctrl-Y in OS X causes bpython to suspend

    When I'm in bpython repl I used to press Ctrl-y to paste stuff from my yank-ring.

    But with the new curtsies UI, when I press C-y bpython is suspended. When I type fg to bring it to foreground it crashes.

    [~]
    $ bpython
    bpython version 0.14.1 on top of Python 2.7.9 /usr/local/opt/python/bin/python2.7
    >>>
    
    [1]  + 35719 suspended  bpython
    FAIL: 18
    
    [~]
    $
    zsh: you have suspended jobs.
    FAIL: 18
    
    [~]
    $ fg
    [1]  + 35719 continued  bpython
    
    Traceback (most recent call last):
      File "/usr/local/bin/bpython", line 11, in <module>
        sys.exit(main())
      File "/usr/local/lib/python2.7/site-packages/bpython/curtsies.py", line 79, in main
        interactive=(not exec_args))
      File "/usr/local/lib/python2.7/site-packages/bpython/curtsies.py", line 172, in mainloop
        e = input_generator.send(0)
      File "/usr/local/lib/python2.7/site-packages/curtsies/input.py", line 128, in send
        return self._send(timeout)
      File "/usr/local/lib/python2.7/site-packages/curtsies/input.py", line 179, in _send
        assert num_bytes > 0, num_bytes
    AssertionError: 0
    FAIL: 1
    

    If I suspend it using C-z, I'm able to resume it without trouble when I do fg.

    I tried this in a linux machine (via docker) and Ctrl-y seems to be working fine.

    opened by amjith 20
  • Allow bpython/bpdb outside main thread

    Allow bpython/bpdb outside main thread

    Because signal.signal is only allowed to be called from the main thread, if you use bpdb in another thread it will crash upon entering the repl. By ignoring the resulting ValueError the show can go on.

    This makes bpdb useful in Django's runserver, even with threading and/or live reload on.

    A question is what to tell the user when this happens? Just ignore it like here, or log something? What on which level?

    Feedback much appreciated.

    Closes #555 I think

    opened by maxnordlund 19
  • Cannot open bpyton

    Cannot open bpyton

    I have installed fresh OX on my Mac, installed bpython and I have been getting errors when I try to start bpython since. This is the error message I am getting:

    Tomics-MBP:~ Tom$ bpython Traceback (most recent call last): File "/usr/local/bin/bpython", line 9, in load_entry_point('bpython==0.15.dev54', 'console_scripts', 'bpython')() File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 357, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2394, in load_entry_point return ep.load() File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2108, in load entry = import(self.module_name, globals(),globals(), ['name']) File "/Library/Python/2.7/site-packages/bpython-0.15.dev54-py2.7.egg/bpython/curtsies.py", line 14, in from bpython.curtsiesfrontend.repl import Repl File "/Library/Python/2.7/site-packages/bpython-0.15.dev54-py2.7.egg/bpython/curtsiesfrontend/repl.py", line 33, in from bpython.config import (Struct, loadini, default_config_path, File "/Library/Python/2.7/site-packages/bpython-0.15.dev54-py2.7.egg/bpython/config.py", line 8, in from six.moves.configparser import ConfigParser ImportError: No module named configparser

    opened by Maka7veli 19
  • Allowing to navigate through code by ctrl+arrows

    Allowing to navigate through code by ctrl+arrows

    Normally, it's possible to navigate through text in terminal (and almost any place) by using ctrl+left/right arrow. In BPython that doesn't work.


    • Bitbucket: https://bitbucket.org/bobf/bpython/issue/201
    • Originally Reported By: Thiago Moraes
    • Originally Created At: 2011-10-04T23:24:04.533
    bug 
    opened by ikanobori 19
  • readline keybindings do not work

    readline keybindings do not work

    Apparently readline keybindings do not work (C-n, C-p, etc..). This is on ActivePython/Linux with the readline module installed.

    IPython readline keybindings works well on the same Python interpreter.

    This project looks amazing that I might contribute some code.... so perhaps I'll fix this issue myself in free time.


    • Bitbucket: https://bitbucket.org/bobf/bpython/issue/39
    • Originally Reported By: Sridhar Ratnakumar
    • Originally Created At: 2009-06-19T00:29:59.285
    bug blocked 
    opened by ikanobori 17
  • Support absolute paths in import completion skip list

    Support absolute paths in import completion skip list

    I get the high CPU from file scanning mentioned in https://github.com/bpython/bpython/issues/845 and https://github.com/bpython/bpython/issues/806 .

    This surprised me because it must have started after an update and the first symptom was my CPU fan spinning on my MBP.

    Is there any way to disable this scanning in my home dir? As another user mentioned, it's common to open bpython in the home dir, and people often have many repos checked out below their home dir.

    A config option in the config file? A dot-file? Something in the .python-profile.py?

    Is there any way to to this today? If not, I would like to request the feature.

    # bpython
    bpython version 0.23 on top of Python 3.10.6 /usr/local/opt/[email protected]/bin/python3.10
    Running profile from ~/.python-profile.py
    .python-profile.py loaded.
    
    help wanted 
    opened by jgspratt 5
  • Making it platform specific or let's fix fcntl problem

    Making it platform specific or let's fix fcntl problem

    It's a long standing problem since I remember, I couldn't get bpython to run on windows, I want to know exactly how big is domain of fcntl model usage and what are the exact usage so I may can help to fix the problem and make it a truly cross platform shell or else, lets make it unavailable for windows, cause it anyway is!

    opened by aarmn 7
  • Enter key doesn't work when i open a new Tkinter window, but Enter key does work when i close the Tkinter window

    Enter key doesn't work when i open a new Tkinter window, but Enter key does work when i close the Tkinter window

    I decide to open a new tkinter window, but when i opened it and i tried to hit enter to input new commands to create a canvas in the new window, the enter key would not function unless i closed the window. e.g.:

    >>> from tkinter import *
    >>> tk = Tk()
    >>> mainloop()
    

    [this opens a new window titled "tk", but i cant hit enter to enter some more commands]

    Ubuntu 20.04.1, and the IDLE i mentioned is python 3.8 and bpython 0.18

    opened by thevibingcat 0
  • Disable terminal default ctrl-s behavior so it can be used for save.

    Disable terminal default ctrl-s behavior so it can be used for save.

    Solution for https://github.com/bpython/bpython/issues/638

    Terminal emulators typically "freeze" the terminal on ctrl-s and continue on ctrl-q. You can run stty -ixon in your terminal or add it to your .bashrc or similar to disable this behavior on ctrl-s. If not disabled, users of bpython can't use ctrl-s to save their session.

    I think we should do the equivalent of this for users automatically. I would guess that more users are annoyed by it but never report than users that want to use scroll control in bpython. I don't think this default behavior of ctrl-s/ctrl-q is very useful in bpython, especially since our output is much slower than python. However ptpython has a similar issue that it also chooses not to automatically fix.

    Hitting F7 is a workaround that opens the current session in a text editor, from which you can save it with a new name. Saving without changing the name saves to a temporary file and re-executes the modified session.

    Note that the say that the way Curtsies implements this behavior is not by turning off this terminal feature (-ixon and -ixoff) but rather by making ctrl-s and ctrl-q no longer do these things.

    opened by thomasballinger 0
Releases(0.23-release)
  • 0.23-release(Aug 30, 2022)

    General information:

    More and more type annotations have been added to the bpython code base. Some work has been performed to stop relying on blessings.

    New features:

    • #905: Auto-closing brackets option added. To enable, add brackets_completion = True in the bpython config. Thanks to samuelgregorovic

    Fixes:

    • Improve handling of SyntaxErrors
    • #948: Fix crash on Ctrl-Z
    • #952: Fix tests for Python 3.10.1 and newer
    • #955: Handle optional readline parameters in stdin emulation. Thanks to thevibingcat
    • #959: Fix handling of __name__
    • #966: Fix function signature completion for classmethods

    Changes to dependencies:

    • curtsies 0.4 or newer is now required
    • Support for Python 3.6 has been dropped.
    Source code(tar.gz)
    Source code(zip)
  • 0.22.1-release(Nov 8, 2021)

  • 0.22-release(Nov 7, 2021)

    General information:

    • The #bpython channel has moved to OFTC.
    • Type annotations have been added to the bpython code base.
    • Declarative build configuration is used as much as possible.

    New features:

    • #883: Allow auto-completion to be disabled
    • #841: Respect locals when using bpython.embed
    • Use pyperclip for better clipboard handling

    Fixes:

    • #700, #884: Fix writing of b"" on fake stdout
    • #879: Iterate over all completers until a successful one is found
    • #882: Handle errors in theme configuration without crashing
    • #888: Read PYTHONSTARTUP with utf8 as encoding
    • #896: Use default sys.ps1 and sys.ps2 if user specified ones are not usable
    • #902: Do not crash when encountering unreadable files while processing modules for import completion
    • #909: Fix sys.stdin.readline
    • #917: Fix tab completion for dict keys
    • #919: Replicate python behavior when running with -i and a non-existing file
    • #932: Fix handling of signature for completion. Thanks to gpotter2

    Changes to dependencies:

    • pyperclip is a new optional dependency for clipboard support
    • backports.cached-property is now required for Python < 3.8
    • dataclasses is now required for Python < 3.7
    • Support for Python 3.10 has been added.
    Source code(tar.gz)
    Source code(zip)
  • 0.21-release(Jan 25, 2021)

    General information:

    • Support for Python 2 has been dropped.

    New features:

    • #643: Provide bpython._version if built from Github tarballs
    • #849: Make import completion skip list configurable
    • #876: Check spelling with codespell Thanks to Christian Clauss

    Fixes:

    • #847: Fix import completion of modules
    • #857: Replace remaining use of deprecated imp with importlib
    • #862: Upgrade curtsies version requirements Thanks to Kelsey Blair
    • #863: State correct default config file directory Thanks to niloct
    • #866: Add more directories to the default import completion skip list
    • #873: Handle 'd' when mapping colors
    • #874: Avoid breakage with six's importer

    Changes to dependencies:

    • curtsies >= 0.3.5 is now required
    • pyxdg is now required
    • wcwidth has been replaced with cwcwidth
    Source code(tar.gz)
    Source code(zip)
  • 0.20.1-release(Nov 13, 2020)

  • 0.20-release(Oct 13, 2020)

    General information:

    • The next release of bpython (0.21) will drop support for Python 2.
    • Support for Python 3.9 has been added. Support for Python 3.5 has been dropped.

    New features:

    • #802: Provide redo. Thanks to Evan.
    • #835: Add support for importing namespace packages. Thanks to Thomas Babej.

    Fixes:

    • #622: Provide encoding attribute for FakeOutput.
    • #806: Prevent symbolic link loops in import completion. Thanks to Etienne Richart.
    • #807: Support packages using importlib.metadata API. Thanks to uriariel.
    • #809: Fix support for Python 3.9's ast module.
    • #817: Fix cursor position with full-width characters. Thanks to Jack Rybarczyk.
    • #853: Fix invalid escape sequences.
    Source code(tar.gz)
    Source code(zip)
  • 0.19-release(Oct 13, 2020)

    General information:

    • The bpython-cli and bpython-urwid rendering backends have been deprecated and will show a warning that they'll be removed in a future release when started.
    • Usage in combination with Python 2 has been deprecated. This does not mean that support is dropped instantly but rather that at some point in the future we will stop running our testcases against Python 2.
    • The new pinnwand API is used for the pastebin functionality. We have dropped two configuration options: pastebin_show_url and pastebin_removal_url. If you have your bpython configured to run against an old version of pinnwand please update it.

    New features:

    Fixes:

    • #765: Display correct signature for decorated functions. Thanks to Benedikt Rascher-Friesenhausen.
    • #776: Protect get_args from user code exceptions
    • Improve lock file handling on Windows
    • #791: Use importlib instead of deprecated imp when running under Python 3

    Support for Python 3.8 has been added. Support for Python 3.4 has been dropped.

    Source code(tar.gz)
    Source code(zip)
  • 0.18-release(Oct 13, 2020)

    New features:

    • #713 expose globals in bpdb debugging. Thanks to toejough.

    Fixes:

    • Fix file locking on Windows.
    • Exit gracefully if config file fails to be loaded due to encoding errors.
    • #744: Fix newline handling. Thanks to Attila Szöllősi.
    • #731: Fix exit code. Thanks to benkrig.
    • #767: Fix crash when matching certain lines in history.

    Support for Python 3.3 has been dropped.

    Source code(tar.gz)
    Source code(zip)
  • 0.17-release(Jul 15, 2017)

    New features:

    • #641: Implement Ctrl+O.
    • Add default_autoreload config option. Thanks to Alex Frieder.

    Fixes:

    • Fix deprecation warnings.
    • Do not call signal outside of main thread. Thanks to Max Nordlund.
    • Fix option-backspace behavior. Thanks to Alex Frieder.
    • #648: Fix paste helper. Thanks to Jakob Bowyer.
    • #653: Handle docstrings more carefully.
    • #654: Do not modify history file during tests.
    • #658: Fix newline handling. Thanks to Attila Szöllősi.
    • #670: Fix handlign of ANSI escape codes. Thanks to Attila Szöllősi.
    • #687: Fix encoding of jedi completions.
    Source code(tar.gz)
    Source code(zip)
  • 0.16-release(Oct 10, 2016)

    New features:

    • #466: Improve handling of completion box height.

    Fixes:

    • Fix various spelling mistakes. Thanks to Josh Soref and Simeon Visser.
    • #601: Fix Python 2 issues on Windows. Thanks to Aditya Gupta.
    • #614: Fix issues when view source. Thanks to Daniel Hahler.
    • #625: Fix issues when runnings scripts with non-ASCII characters.
    • #639: Fix compatbility issues with pdb++. Thanks to Daniel Hahler.

    Support for Python 2.6 has been dropped.

    Source code(tar.gz)
    Source code(zip)
  • 0.15-release(Oct 10, 2016)

    This release contains new features and plenty of bug fixes.

    New features:

    • #425: Added curtsies 0.2.x support.
    • #528: Hide private attribute from initial autocompletion suggestions. Thanks to Jeppe Toustrup.
    • #538: Multi-line banners are allowed.
    • #229: inspect.getsource works on interactively defined functions. Thanks to Michael Mulley.
    • Attribute completion works on literals and some expressions containing builtin objects.
    • Ctrl-e can be used to autocomplete current fish-style suggestion. Thanks to Amjith Ramanujam.

    Fixes:

    • #484: Switch bpython.embed to the curtsies frontend.
    • #548 Fix transpose character bug. Thanks to Wes E. Vial.
    • #527 -q disables version banner.
    • #544 Fix Jedi completion error.
    • #536 Fix completion on old-style classes with custom getattr.
    • #480 Fix old-style class autocompletion. Thanks to Joe Jevnik.
    • #506 In python -i mod.py sys.modules[name] refers to module dict.
    • #590 Fix "None" not being displayed.
    • #546 Paste detection uses events instead of bytes returned in a single os.read call.
    • Exceptions in autocompletion are now logged instead of crashing bpython.
    • Fix reload in Python 3. Thanks to sharow.
    • Fix keyword argument parameter name completion.

    Changes to dependencies:

    • requests[security] has been changed to pyOpenSSL, pyasn1, and ndg-httpsclient. These dependencies are required before Python 2.7.7.
    Source code(tar.gz)
    Source code(zip)
  • 0.14.2-release(Oct 10, 2016)

    Fixes:

    • #498: Fixed is_callable
    • #509: Fixed fcntl usage.
    • #523, #524: Fix conditional dependencies for SNI support again.
    • Fix binary name of bpdb.
    Source code(tar.gz)
    Source code(zip)
  • 0.14.1-release(Mar 1, 2015)

    Fixes:

    • #483: Fixed jedi exceptions handling.
    • #486: Fixed Python 3.3 compatibility.
    • #489: Create history file with mode 0600.
    • #491: Fix issues with file name completion.
    • #494: Fix six version requirement.
    • Fix conditional dependencies for SNI support in Python versions before 2.7.7.
    Source code(tar.gz)
    Source code(zip)
  • 0.14-release(Feb 16, 2015)

    This release contains major changes to the frontends:

    • curtsies is the new default frontend.
    • The old curses frontend is available as bpython-curses.
    • The GTK+ frontend has been removed.

    New features:

    • #194: Syntax-highlighted tracebacks. Thanks to Miriam Lauter.
    • #234: Copy to system keyboard.
    • #285: Re-evaluate session and reimport modules.
    • #313: Warn when undo may take cause extended delay, and prompt to undo multiple lines.
    • #322: Watch imported modules for changes and re-evaluate on changes.
    • #328: bpython history not re-evaluated to edit a previous line of a multiline statement.
    • #334: readline command Meta-. for yank last argument. Thanks to Susan Steinman and Steph Samson.
    • #338: bpython help with F1.
    • #354: Edit config file from within bpython.
    • #382: Partial support for pasting in text with blank lines.
    • #410: Startup banner that shows Python and bpython version
    • #426: Experimental mutliline autocompletion.
    • fish style last history completion with Arrow Right. Thanks to Nicholas Sweeting.
    • fish style automatic reverse history search with Arrow Up. Thanks to Nicholas Sweeting.
    • Incremental forward and reverse search.
    • All readline keys which kill/cut text correctly copy text for paste with Ctrl-y or Meta-y.
    • French translation.
    • Removal links for bpaste pastebins are now displayed.
    • More informative error messages when source cannot be found for an object. Thanks to Liudmila Nikolaeva and Miriam Lauter.
    • Message displayed if history in scrollback buffer is inconsistent with output from last re-evaluation of bpython session. Thanks to Susan Steinman.
    • Adjust logging level with -L or -LL.
    • String literal attribute completion.

    Fixes:

    • #254: Use ASCII characters if Unicode box characters are not supported by the terminal.
    • #284: __file__ is in scope after module run with bpython -i. Thanks to Lindsey Raymond.
    • #347: Fixed crash on unsafe autocompletion.
    • #349: Fixed writing newlines to stderr.
    • #363: Fixed banner crashing bpython-urwid. Thanks to Luca Barbato.
    • #366, #367: Fixed help() support in curtsies.
    • #369: Interactive sessions inherit compiler directives from files run with -i interactive flag.
    • #370, #401, #440, #448, #468, #472: Fixed various display issues in curtsies.
    • #391: Fixed crash when using Meta-backspace. Thanks to Tony Wang.
    • #438, #450: bpython-curtsies startup behavior fixed. Errors during startup are reported instead of crashing.
    • #447: Fixed behavior of duplicate keybindings. Thanks to Keyan Pishdadian.
    • #458: Fixed dictionary key completion crash in Python 2.6. Thanks to Mary Mokuolu.
    • Documentation fixes from Lindsey Raymond.
    • Fixed filename completion.
    • Fixed various Unicode issues in curtsies.
    • Fixed and re-enabled dictionary key completion in curtsies.

    The commandline option --type / -t has been renamed to --paste / -p.

    Python 2.6, 2.7, 3.3 and newer are supported. Support for 2.5 has been dropped. Furthermore, it is no longer necessary to run 2to3 on the source code.

    This release brings a lot more code coverage, a new contributing guide, and most of the code now conforms to PEP-8.

    Changes to dependencies:

    • greenlet and curtsies are no longer optional.
    • six is a new dependency.
    • jedi is a new optional dependency required for multiline completion.
    • watchdog is a new optional dependency required for watching changes in imported modules
    Source code(tar.gz)
    Source code(zip)
  • 0.13.2-release(Jan 10, 2015)

    A bugfix release. The fixed bugs are:

    • #424: Use new JSON API at bpaste.net.
    • #430: Fixed SNI issues with new pastebin service on Mac OS X.
    • #432: Fixed crash in bpython-curtsies in special circumstances if history file is empty. Thanks to Lisa van Gelder.
    Source code(tar.gz)
    Source code(zip)
  • 0.13.1-release(Jan 10, 2015)

    A bugfix release. The fixed bugs are:

    • #287: Turned off dictionary completion in bpython-curtsies
    • #281: Fixed a crash on error-raising properties
    • #286: Fixed input in Python 3
    • #293: Added encoding attribute to stdin bpython curtsies
    • #296: Fixed warnings in import completion for Python 3
    • #290: Stop using root logger
    • #301: Specify curtsies version in requirements

    There's also a necessary regression: #232 (adding fileno() on stdin) is reintroduced because its previous fix was found to be the cause of #286.

    Source code(tar.gz)
    Source code(zip)
  • 0.13-release(Jan 10, 2015)

    0.13

    There are a few new features, a bunch of bugfixes, and a new frontend for bpython in this release.

    • Dictionary key completion, thanks to Maja Frydrychowicz (#226). To use normal completion and ignore these key completions, type a space.
    • Edit current line in external editor: ctrl-x (#161)

    Fixes:

    • Python 2.5 compatibility, thanks to Michael Schuller (#279). Python 2.5 is not officially supported, but after few changes Michael introduced, he says it's working fine.
    • FakeStream has flush(), so works correctly with django.core.email.backends.console thanks to Marc Sibson (#259)
    • FakeStdin has fileno() (#232)
    • Changes to sys.ps1 and sys.ps2 are respected thanks to Michael Schulle (#267)
    • atexit registered functions run on exit (#258)
    • fixed an error on exit code when running a script with bpython script.py (#260)
    • setup.py extras are used to define dependencies for urwid and curtsies frontends

    There's a new frontend for bpython: bpython-curtsies. Curtsies is a terminal wrapper written to making native scrolling work in bpython. (#56, #245) Try bpython-curtsies for the bpython experience with a vanilla python layout. (demo: http://ballingt.com/assets/bpython-curtsies-scroll-demo-large.gif)

    This curtsies frontend addresses some issues unfixed in bpython-cli, and has a few extra features:

    • Editing full interpreter history in external editor with F7, which is rerun as in rewind
    • A new interpreter is used for rewind, unless bpython-curtsies was started with custom locals or in interactive mode (#71)
    • Ctrl-c behaves more like vanilla python (#177)
    • Completion still works if cursor at the end of the line (#147)
    • Movement keys meta-b, meta-f, and meta-backspace, ctrl-left and ctrl-right are all honored (#246, #201)
    • Non-ascii characters work in the file save prompt (#236)
    • New --type / -t option to run the contents of a file as though they were typed into the bpython-curtsies prompt

    A few things about bpython-curtsies are worse than regular bpython:

    • Bad things can happen when using several threads (#265)
    • output prints slowly (#262)
    • bpython-curtsies can't be backgrounded and resumed correctly (via ctrl-z, fg) (#274)

    There are two new options in the new [curtsies] section of the bpython config

    • list_above: whether completion window can cover text above the current line; defaults to True
    • fill_terminal: whether bpython-curtsies should be fullscreen (like bpython); defaults to False
    Source code(tar.gz)
    Source code(zip)
Owner
bpython
assorted repositories related to the bpython interpreter
bpython
A curated list of awesome Jupyter projects, libraries and resources

Awesome Jupyter A curated list of awesome Jupyter projects, libraries and resources. Jupyter is an open-source web application that allows you to crea

Markus Schanta 3.1k Dec 30, 2022
bpython - A fancy curses interface to the Python interactive interpreter

bpython: A fancy curses interface to the Python interactive interpreter bpython is a lightweight Python interpreter that adds several features common

bpython 2.2k Dec 27, 2022
A better Python REPL

ptpython A better Python REPL pip install ptpython Ptpython is an advanced Python REPL. It should work on all Python versions from 2.6 up to 3.9 and

prompt-toolkit 4.6k Dec 31, 2022