Changing ' to " in printed representation of dictionaries

  • Thread starter Burton Samograd
  • Start date
B

Burton Samograd

Hello,

I was wondering if there was a way to change the quote character for
keys in string representation of dictionaries, so that they will be JSON
equivalent. For example:
'{ "x": 1, "y": 2 }' # JSON and python compatible

So the question is, is there an automatic way to tell python to use "
instead of ' when doing a repr of lists?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top