I cannot change the colors in the editor for Python code

조회 수: 1 (최근 30일)
Kathryn Lund
Kathryn Lund 2023년 2월 22일
답변: Kathryn Lund 2023년 2월 22일
I'm using R2022a in dark mode, and I need to call a script in Python. Unfortunately the code editor defaults to some colors that are basically illegible (blue too dark for black background), but I can't seem to change them. The only colors I see in MATLAB Colors Preferences clearly do not correspond to what appears in the editor.
Any ideas on how to fix this?
  댓글 수: 1
Kathryn Lund
Kathryn Lund 2023년 2월 22일
편집: Kathryn Lund 2023년 2월 22일
Under Preferences --> Editor/Debugger --> Language, I have found syntax highlighting options for various languages, but Python isn't one of them. Adding a Python file extension to one of them does not solve the problem either (even after ending and restarting a MATLAB session). I guess my issue could be solved if Python had its own Editor/Debugger Language Preferences.

댓글을 달려면 로그인하십시오.

답변 (1개)

Kathryn Lund
Kathryn Lund 2023년 2월 22일
Navigate to MATLAB Editor/Debugger Language Preferences via Preferences (gear wheel) --> Editor/Debugger --> Language. Choose MATLAB as the language from the drop-down list. Add "py" to the list of File Extensions. Restart MATLAB.
It's a bit of a hack for now, but at least I can read the script without opening another program and get some (minimal) syntax highlighting.
Would still love an answer that shows how to set up an Editor/Debugger profile for Pythong.

카테고리

Help CenterFile Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by