2

I am using spyder python 2.7 and i changed the syntax coloring in Spyder black theme, but i really want my python programme to look in full black, so WITHOUT the white windows.

Can someone provide me a good explanation about how to change this?

Python example of how i want it to be

Carlos Cordoba
  • 33,273
  • 10
  • 95
  • 124
ninja
  • 55
  • 1
  • 1
  • 6
  • 1
    [https://stackoverflow.com/questions/40595961/how-to-change-the-spyder-editor-background-to-dark] . Duplicate – Noordeen Feb 22 '19 at 18:46
  • Yep. Was about to post that myself – PrinceOfCreation Feb 22 '19 at 18:50
  • 1
    It is not the same question, I know how to change it in python, however it is partially black. So i was wondering if someone knows how to change it in full black with a code using the package qdarkstyle or something else? – ninja Feb 22 '19 at 19:03

4 Answers4

4

The complete dark theme is available from Spyder 4.0.0 beta https://github.com/spyder-ide/spyder/releases

How I did it :

1) In Anaconda prompt,

conda update qt pyqt
conda install -c spyder-ide spyder=4.0.0b2

2) And if you haven't done it before, go to

Tools > Preferences > Syntax Coloring
KaHinCostner
  • 167
  • 3
  • 17
3

If you can't wait for Spyder 4 - this is what does it for Spyder 3.3.2 in Windows, using Anaconda3.

  1. Exit Spyder
  2. Open command prompt or Anaconda prompt
  3. Run pip install qdarkstyle and exit the prompt
  4. Go to ...\Anaconda3\Lib\site-packages\spyder\utils and open qhelpers.py
  5. Add import qdarkstyle to the top of that file
  6. Replace the qapplication function definition with below code (only two added lines)
  7. Save and close the file
  8. Open Spyder and enjoy your dark theme

    def qapplication(translate=True, test_time=3):
        """
        Return QApplication instance
        Creates it if it doesn't already exist
    
        test_time: Time to maintain open the application when testing. It's given
        in seconds
        """
        if running_in_mac_app():
            SpyderApplication = MacApplication
        else:
            SpyderApplication = QApplication
    
        app = SpyderApplication.instance()
        if app is None:
            # Set Application name for Gnome 3
            # https://groups.google.com/forum/#!topic/pyside/24qxvwfrRDs
            app = SpyderApplication(['Spyder'])
            # Set application name for KDE (See issue 2207)
            app.setApplicationName('Spyder')
            app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
        if translate:
            install_translator(app)
    
        test_ci = os.environ.get('TEST_CI_WIDGETS', None)
        if test_ci is not None:
            timer_shutdown = QTimer(app)
            timer_shutdown.timeout.connect(app.quit)
            timer_shutdown.start(test_time*1000)
        return app
    
Dr.Ripper
  • 89
  • 8
  • This doesn't work very well because i) our icons won't change to a light color and ii) the Help pane remains in white. Besides, this code will be overwritten every time you update Spyder. – Carlos Cordoba Apr 03 '19 at 15:53
  • 2
    True, it's just a quick and dirty way to integrate qdarkstyle - I'm sure there are more robust ways. I thought I'd share it nevertheless. – Dr.Ripper Apr 03 '19 at 18:29
  • 1
    I'm super glad you shared this. It's a quick and easy fix too. Thanks for saving my eyes Dr. Ripper! – obewanjacobi Sep 17 '19 at 18:58
1

(Spyder maintainer here) This functionality will be available in Spyder 4, to be released later in 2019. For now there's nothing you can do to get what you want with Spyder's current version, sorry.

Carlos Cordoba
  • 33,273
  • 10
  • 95
  • 124
  • 1
    Spyder 4.0.1 is now available. As per the [documentation](https://github.com/spyder-ide/spyder/releases), install it with `conda install spyder=4.0.1` – Nicolas Gervais Jan 10 '20 at 18:35
1

Spyder 4 is out now. Dark mode is included ✌

Have a look at the changes: https://github.com/spyder-ide/spyder/blob/master/CHANGELOG.md

chainstair
  • 681
  • 8
  • 18