简体   繁体   中英

How do You Hack the Enthought Canopy Editor Background Color?

I use Enthought Canopy sometimes for writing python and I like the option to change the background of the interactive interpreter, but there is not an option for changing the background color of the editor.

I'd like to change the color to black(ish), if possible. I think you could set it in the preferences.ini file, but I don't know the keywords and can't find any documentation on what arguments canopy accepts. I think the setting would be in a file called preferences.ini, but I'm not sure, by any means.

Preferences.ini - Windows C:\\Users\\\\AppData\\Roaming\\Enthought\\Canopy\\preferences.ini

Preferences.ini - Mac ~/.canopy/preferences.ini

Here is an example of what the preferences.ini file looks like:

[sessions]
startup_mode = show_last_window
[python_frontend]
theme = linux
prompt_on_exit = True
[code_editor]
right_margin_enabled = True
right_margin_column = 80
smart_parenthesis_enabled = False
tab_completion_enabled = True
[accounts]
first_name = Brave
last_name = SirRobin
authenticated = True
[main]
font = 9 point Inconsolata Light

Has anyone done this or does anyone have any suggestions?

ConfigParser is made for that

it reads config file like you expect

for example

import configparser
config = configparser.ConfigParser()
config.read('preferences.ini')
['preferences.ini']
a=config.get('sessions','startup_mode')
print (a) # -> "show_last_window" show_last_window
b=config.get('python_frontend','theme')
print (b) # -> "linux" linux

I don't know a ton so this might be useless depending on what you mean by editor, but I know you can at least change the "kernel" window by going to edit > preferences > python tab and select dark background.

I prefer to work with it like this, even if I can't have it dark in the editor screen.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM