Home > python > bpython config file for light background

bpython config file for light background

The default color scheme of bpython is designed for dark background. If you launch bpython with light background, it’s almost unreadable. Is there a color scheme for light background?

Create the dir ~/.bpython and add the following files:


# This is a standard python config file
# Valid values can be True, False, integer numbers, strings
# By default bpython will look for ~/.bpython/config or you can specify a file
# with the -c option on the command line

# General section tag

# Display the autocomplete list as you type (default: True).
# When this is off, you can hit tab to see the suggestions.
auto_display_list = True

# Syntax highlighting as you type (default: True).
syntax = True

# Display the arg spec (list of arguments) for callables,
# when possible (default: True).
arg_spec = True

# History file (default: ~/.pythonhist):
hist_file = ~/.pythonhist

# Number of lines to store in history (set to 0 to disable) (default: 100):
hist_len = 100

# Soft tab size (default: 4, see pep-8):
tab_length = 4

# Color schemes should be put in ~/.bpython/
# e.g. to use the theme ~/.bpython/foo.theme set color_scheme = foo
# Leave blank or set to "default" to use the default theme
#color_scheme = default
color_scheme = jabba

pastebin = F8
save = C-s

~/.bpython/jabba.theme (derived from light.theme):

# Each letter represents a colour marker:
#   k, r, g, y, b, m, c, w, d
# which stands for:
#   blacK, Red, Green, Yellow, Blue, Magenta, Cyan, White, Default
# Capital letters represent bold
# Copy to ~/.bpython/foo.theme and set "color_scheme = foo" in
# ~/.bpython/config

keyword = B
name = r
comment = b
string = g
error = r
number = B
operator = b
paren = b
punctuation = b
token = g

# XXX: gnome-terminal appears to be braindead. The cursor will disappear unless
# you set the background colour to "d".
background = d
output = b
main = b
prompt = b
prompt_more = g


Update (20160214)
As it was pointed out by Leonardo in a comment (thanks!), “you need to put the configuration files inside ~/.config/bpython instead of ~/.bpython.” Yeah, applications in newer Linux versions prefer the ~/.config folder.

  1. October 9, 2013 at 11:47

    Thank you! I installed solarized light theme for my gnome-terminal several month ago, and using bpython with it was really painfull. Now all works just great.

    • October 9, 2013 at 12:07

      I’m surprised that bpython thinks by default that everybody uses dark background… Strange. I’m glad it works for you.

  2. July 7, 2014 at 05:10

    Thank you so much for this – this was driving me nuts and following the instruction on bpython’s website I was getting a ‘cannot load theme’ error!

  3. July 15, 2014 at 13:05

    Thanks Bro!

  4. December 3, 2015 at 09:17

    Thank you for the theme! It’s really great.

    I’m using bpython 0.14.2 and now, at least for me, you need to put the configuration files inside `~/.config/bpython` instead of `~/.bpython`.

  5. October 3, 2016 at 10:07

    Works great on Opensuse leap.
    Created ~/.bpython btw.

  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: