Thanks for the heads up guys, it turned out that my JSON was
malformed, I got carried away and made variable assignments in some
places:
test = {} instead of "test":{}
:-)) am I glad that that problem is gone
On Jun 22, 5:47 pm, "Brent Pedersen" <[EMAIL PROTECTED]> wrote:
> works for me. python 2.4.4c1
>
> In [1]: import simplejson
>
> In [2]: inline = """
> ...: {
> ...: "domain-name" : "www.test.com",
> ...: "language" : "English",
> ...: "test" : ["one", "two", "three"]
> ...: }
> ...: """
>
> In [3]: simplejson.loads(inline)
> Out[3]:
> {u'domain-name': u'www.test.com',
> u'language': u'English',
> u'test': [u'one', u'two', u'three']}
>
> In [4]: simplejson.__version__
> Out[4]: '1.7.1'
>
> On 6/22/07, voltron <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi Brent, sadly, it still does not work, I even tried stripping some
> > things off: This is all I have in the javascript file:
>
> > r"""{
> > "domain-name" : "www.gameolymp.de",
> > "language" : "German"
> > }
> > """
>
> > This causes a decode error also
>
> > On Jun 22, 4:44 pm, "Brent Pedersen" <[EMAIL PROTECTED]> wrote:
> > > hi, i think it'll load without "site =".
>
> > > On 6/22/07, voltron <[EMAIL PROTECTED]> wrote:
>
> > > > I apologize beforehand for posting this here, I was not sure where I
> > > > should post it, I just counted on the fact that maybe one of you guys
> > > > uses simplejson.
>
> > > > I have tried loading a json object from a js file, simplejson
> > > > complains about not being able to decode, I made a test of just
> > > > simplifying the JSON object and putting it in my controller for
> > > > loading, but that did not work either
>
> > > > #code
>
> > > > inline = """
> > > > site = {
> > > > "domain-name" : "www.test.com",
> > > > "language" : "English",
> > > > "test" : ["one", "two", "three"]
> > > > }
> > > > """
> > > > simplejson.loads(inline)
>
> > > > # end code
>
> > > > Is my JSON formatting off? It is pretty simple, Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---