bpython config file for light background
Problem
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?
Solution
Create the dir ~/.bpython and add the following files:
~/.bpython/config:
# 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 [general] # 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 [keyboard] 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 [syntax] keyword = B name = r comment = b string = g error = r number = B operator = b paren = b punctuation = b token = g [interface] # 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.
Categories: python
bpython, color scheme, color theme, light background


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.
I’m surprised that bpython thinks by default that everybody uses dark background… Strange. I’m glad it works for you.
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!
Thanks Bro!
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`.
Works great on Opensuse leap.
Created ~/.bpython btw.