0

I am trying to figure out how to configure Pycharm to use " and not ' when printing to console.
I've checked it, and it doesn't matter what I am using in the code itself, even if it is:

print({"Hello World": "Great!"})

It shows up like:

{'Hello World': 'Great!'}

and not

{"Hello World": "Great!"}

As desired, I need this because when I want to format a long dictionary and view it as a nice indented JSON (and not a long line), it doesn't work as it is not a valid JSON as it uses the single quotation mark.

Any ideas? Thanks!

CodeCop
  • 1
  • 2
  • 15
  • 37
  • 2
    Why not do `print(json.dumps(mydict, indent=4))`? – snakecharmerb Dec 05 '22 at 16:07
  • Why not use `rep()` – Ari Dec 05 '22 at 16:08
  • @snakecharmerb That's a nice work-around, I like it. But it adds unnecessary code... viewing it in the console itself is weird and unintuitive, I like to copy it to Sublime or other programs... – CodeCop Dec 05 '22 at 16:12
  • [Related](https://stackoverflow.com/a/1675295/5320906) – snakecharmerb Dec 05 '22 at 16:17
  • PyCharm's console is just a plugin wrapping your [standard interpreter console](https://docs.python.org/3/tutorial/interpreter.html) so if Python's interactive console can't be configured to show double quotes instead of backticks the IDE isn't going to override that. – bad_coder Dec 05 '22 at 18:59

0 Answers0