Be the first to know about special offers and new products for web developers and Internet business owners.
I will never share your email address with the bad boys. Period.
|
Be the first to know about special offers and new products for web developers and Internet business owners. I will never share your email address with the bad boys. Period.
The latest
|
jsonQuotes causing problem with Python and simplejsonSubmitted by alexis on Fri, 2008-10-17 16:47.
My application will receive a string of JSON and transform it to a dictionary, pretty simple. Let's run a test first, starting with the Python shell, or better yet, iPython, and importing the module:
Now let's define a string using JSON notation and pass it to simplejson:
And we get a ValueError exception. Let's try using simple quotes for enclosing the whole string and double quotes for the JSON keys and values:
And there you go, no error now:
I find a little strange that this problem happens as I've been using either type of quotes for most of my Python coding. Had you noticed this problem? I've checked simplejson's documentation and could not find anything related to this. One last word, the new Python 2.6 includes a json module, which is a refactored simplejson. Neat. |
Want to launch a online store, need a new look for your website, market your services on the Net or build a virtual community? Not a problem, let's talk about it. Where To Host Your Sites? |
Recent comments
5 days 19 hours ago
1 week 2 days ago
1 week 3 days ago
2 weeks 1 day ago
2 weeks 2 days ago
2 weeks 2 days ago
2 weeks 4 days ago
3 weeks 1 day ago
4 weeks 5 hours ago
4 weeks 6 days ago