Forums

Dark Theme

Hi,

When editing files is it possible to switch to a dark theme?

Thanks

Phil

We don't have an official way to do that, but there is a hack that can get it working for a specific editing session. When you load the file, press control-comma, and a popup will appear on the right. There you can select between various editor themes.

(It's not official yet because we don't have a way to make it persist between editor sessions right now -- that's proving harder to do than one might expect.)

It will be great.. cuz white color eat my eyes x_x

Any updates here? My eyes burn too.... would it make sense to have a user-specific setting that applies to all their sessions?

No updates.

So, nice thanks

For those coming here from Google,

There is a Google Chrome add on here:

Python Anywhere Dark Editor

Hello PA team! Any updates on dark mode?

Thanks a lot

@tucapel -- we haven't worked on that recently but I bumped up our ticket regarding this issue on your behalf. You can change the theme using Ace editor settings (to enter them press Ctrl-, (control + comma) in the editor), but unfortunately, you can't save them.

Wow guys, this is sad. Forget the editor, how do you not have a site-wide dark theme? I don't think I would have even signed up for pythonanywhere if had not already been using... darkreader.org For everyone frustrated by this, just use this awesome plugin on every site and 'save your eyes'. 'PythonAnywhere Dark Editor' featured above is great and offers better syntax highlighting than the default theme on PA, but darkreader fixes the rest of the site.

Thanks for sharing your experience!

Any updates on Dark mode?

No, no update

Hey Guys! Is there any way to manually change the internal configuration of ACE to select a default theme?

Not at the moment afaik

That is sad, i love this service but my eyes suffer

I agree wholeheartedly

Hi everyone! I found a very effective way to automatically set the theme you want when you open a file in Pythonanywhere. I'll explain the process here. What we need is to execute a JS command to change the ACE settings and set the theme you prefer. So, I set myself the task of finding that JS command, which is this:

Anywhere.Editor.editor.setTheme('ace/theme/(theme_id)')

This is the full list of all the dark themes IDs:

"ambiance","chaos","dawn","dreamweaver","chaos","clouds_midnight","cobalt","idle_fingers","kr_theme","merbivore","merbivore_soft","mono_industrial","monokai","pastel_on_dark","solarized_dark","terminal","tomorrow_night","tomorrow_night_blue","tomorrow_night_bright","tomorrow_night_eighties","twilight","vibrant_ink"

Ok, once you’ve chosen the theme you prefer (remember you can try all of them by pressing Ctrl+Comma), you need to replace the (theme_id) part with your Id's theme, for example:

Anywhere.Editor.editor.setTheme('ace/theme/tomorrow_night') // I choose 'Tomorrow Night'

All right! If we execute the command in a Pythonanywhere file we'll see that the theme changes successfully, now that we have the JS command with the theme we want to set, we need to execute that command every time we open a file in PythonAnywhere. We need to use a browser add-on, like Tampermonkey or another that executes a JS command when we enter a specific URL. There are many options, you just need to use the one that works best with your browser.

Finally, you need to configure the URL (in the Add-on of your browser) in a manner similar to this https://www.pythonanywhere.com/user/(your_username)/files/*

Replacing (your_username) with your real user name.

That’s all! With this, each time you open a file in PythonAnywhere, the theme is automatically set. I hope you like this method of auto-setting the theme. If you have any questions, dont hesiate to ask and I’ll try to answer!

That's pretty cool -- thanks for posting it!

I created a simple Chrome extension using the solution provided by @radioterapia above. You can load it by selecting ‘Load Unpacked Extension’ in chrome://extensions/

This extension saves your preferences and automatically applies them every time you visit the page.

Here it is

https://github.com/MuhammadSaboorIslam/betterAnywhere

Interesting. Thanks.

It would be amazing that we could configure themes in pythonanywhere liike for example some anime background. Please add that feature soon!!

@FranciscoGibert thanks for the feedback!