Changing color of object in f-strings
See original GitHub issueProblem Description
I have a very simple issue that I haven’t found an answer for here or online. Apologies if it exists somewhere.
Inside of f-strings, I’m wondering if there is a way to change the color of the object. For example in, f'hello my name is {name}'
, I’m wondering if there is a way in spyder to set the color scheme such that {name} appears a different color than the rest of the string.
Cheers!
- Spyder version: 4.01
- Python version: 3.7.6
- Qt version: 5.9.6
- PyQt version: 5.9.2
- Operating System name/version: rhel 7
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
[Feature] Format Python f-strings with different color for code in ...
The code portion of f-strings (in { } brackets) should be formatted in a different color than the rest of the string.
Read more >f-strings and termcolor - Python Forum
Sep-21-2019, 03:37 PM. Hi! This problem came up when I was searching for ways to colour and give styles to strings:
Read more >Printing f-strings in color in Jupyter with escape characters in ...
My understanding is that I need Markdown to print in color, but obviously the brackets are causing problems with the f-strings in Markdown...
Read more >How to highlight in different colors for variables inside `fstring ...
I am using python-mode which colors the parameters. When I concatinate strings the variable color is ...
Read more >Change color of f-strings variables
Hi, I would like to know how to change the yellowish highlight of the variables inside the curly braces of f-strings. I've looked...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks, @andfoy, for your work on Spyder. I really like it and use it a lot! I just wanted to say, though, that the same issue still happens in Spyder 5.0.5. My specifications are Python 3.9.6 64-bit, Qt 5.9.7, PyQt5 5.9.2 and Windows 10 .
Incidentally, if I put this in the IPython console, then it behaves as desired.
So it seems like it has only been partially implemented?
This will be fixed in Spyder 6, to be released at the end of the year or beginning of the next one.