I want to have a JSON object with the value of an attribute as a string with the character '. For example:
{ 'Dimensions' : ' 12.0' x 9.6' ' }
Obviously this is not possible. How do I do this? With Python.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Isaac is correct.
As for how to do it in python, you need to provide a more detailed explanation of how you are building your
JSONobject. For example, let’s say you’re using no external libraries and are doing it manually (ridiculous, I know), you would do this:Obviously this is kind of silly. If you are using the standard python json module, try this:
which is the desired result.