让 Spyder 为整个界面使用深色主题
Make Spyder use a dark theme for the entire interface
我正在使用 spyder python 2.7,我更改了 Spyder 黑色主题中的语法着色,但我真的希望我的 python 程序看起来是全黑的,所以没有白色 windows.
谁能给我一个关于如何改变这个的好解释?
Python example of how i want it to be
(Spyder maintainer here) 此功能将在 Spyder 4 中可用,将于 2019 年晚些时候发布。目前还没有你可以用 Spyder 的当前版本来获得你想要的东西,抱歉。
如果您等不及 Spyder 4 - 这就是 Spyder 3.3.2 在 Windows 中的作用,使用 Anaconda3。
- 退出 Spyder
- 打开命令提示符或 Anaconda 提示符
- 运行
pip install qdarkstyle
并退出提示
- 转到...\Anaconda3\Lib\site-packages\spyder\utils 并打开
qhelpers.py
- 将
import qdarkstyle
添加到该文件的顶部
- 用下面的代码替换
qapplication
函数定义(只添加了两行)
- 保存并关闭文件
打开 Spyder,享受深色主题
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
完整的深色主题可从 Spyder 4.0.0 beta https://github.com/spyder-ide/spyder/releases
我是怎么做到的:
1) 在 Anaconda 提示符下,
conda update qt pyqt
conda install -c spyder-ide spyder=4.0.0b2
2) 如果您以前没有做过,请转到
Tools > Preferences > Syntax Coloring
Spyder 4 现已发布。包含深色模式 ✌
看看变化:
https://github.com/spyder-ide/spyder/blob/master/CHANGELOG.md
我正在使用 spyder python 2.7,我更改了 Spyder 黑色主题中的语法着色,但我真的希望我的 python 程序看起来是全黑的,所以没有白色 windows.
谁能给我一个关于如何改变这个的好解释?
Python example of how i want it to be
(Spyder maintainer here) 此功能将在 Spyder 4 中可用,将于 2019 年晚些时候发布。目前还没有你可以用 Spyder 的当前版本来获得你想要的东西,抱歉。
如果您等不及 Spyder 4 - 这就是 Spyder 3.3.2 在 Windows 中的作用,使用 Anaconda3。
- 退出 Spyder
- 打开命令提示符或 Anaconda 提示符
- 运行
pip install qdarkstyle
并退出提示 - 转到...\Anaconda3\Lib\site-packages\spyder\utils 并打开 qhelpers.py
- 将
import qdarkstyle
添加到该文件的顶部 - 用下面的代码替换
qapplication
函数定义(只添加了两行) - 保存并关闭文件
打开 Spyder,享受深色主题
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
完整的深色主题可从 Spyder 4.0.0 beta https://github.com/spyder-ide/spyder/releases
我是怎么做到的:
1) 在 Anaconda 提示符下,
conda update qt pyqt
conda install -c spyder-ide spyder=4.0.0b2
2) 如果您以前没有做过,请转到
Tools > Preferences > Syntax Coloring
Spyder 4 现已发布。包含深色模式 ✌
看看变化: https://github.com/spyder-ide/spyder/blob/master/CHANGELOG.md