Re: parsing json output

2008-03-26 Thread Gowri
Hi all, Thank you so much for all your help :) I really appreciate it. I discovered that my problem was because of my firewall and everything works now :) Regards, Gowri -- http://mail.python.org/mailman/listinfo/python-list

Re: parsing json output

2008-03-24 Thread Paul McGuire
On Mar 18, 9:10 pm, Gowri <[EMAIL PROTECTED]> wrote: > Hi, > > I have a service running somewhere which gives me JSON data. What I do > is this: > > import urllib,urllib2 > import cjson > > url = 'http://cmsdoc.cern.ch/cms/test/aprom/phedex/dev/gowri/datasvc/ > tbedi/requestDetails' > params = {'fo

Re: parsing json output

2008-03-23 Thread Gowri
Hi Tim, I'm able to get and print correctly some HTML content. I don't know how to fix this. Need all the help I can get with this :) Regards, Gowri -- http://mail.python.org/mailman/listinfo/python-list

Re: parsing json output

2008-03-20 Thread Tim Roberts
Gowri <[EMAIL PROTECTED]> wrote: > >I understand it's JSON. My problem is that it just prints crazy >characters instead of the JSON data. Ah, I see. I didn't get that from your original post. >Like I mentioned, this happens on >my windows machine which has python 2.5. On the other hand, the same

Re: parsing json output

2008-03-20 Thread Gowri
Hi Tim, I understand it's JSON. My problem is that it just prints crazy characters instead of the JSON data. Like I mentioned, this happens on my windows machine which has python 2.5. On the other hand, the same code worked perfectly great on my linux machine with python 2.3.4. What could the prob

Re: parsing json output

2008-03-19 Thread Tim Roberts
Gowri <[EMAIL PROTECTED]> wrote: > >I have a service running somewhere which gives me JSON data. >... >This prints a whole bunch of nonsense as expected. It's not nonsense. It's JSON. >I use cjson and am >unable to figure out how to print this json response You are already printing the JSON re

Re: parsing json output

2008-03-18 Thread Gowri
I actually have a weirder problem. The code I posted earlier prints garbage on Windows and python 2.5 and the perfect json data on RHEL python 2.3.4. I'm so confused and helpless. json.py doesn't seem to help either. It says raise ReadException, "Input is not valid JSON: '%s'" % self._generator.al

Re: parsing json output

2008-03-18 Thread Gowri
Thanks for your reply Justin. But how do I do it with cjson? -- http://mail.python.org/mailman/listinfo/python-list

Re: parsing json output

2008-03-18 Thread Justin Ezequiel
FWIW, using json.py I got from somewhere forgotten, >>> import json >>> url = >>> 'http://cmsdoc.cern.ch/cms/test/aprom/phedex/dev/gowri/datasvc/tbedi/requestDetails' >>> params = {'format':'json'} >>> import urllib >>> eparams = urllib.urlencode(params) >>> import urllib2 >>> request = urllib2.R

parsing json output

2008-03-18 Thread Gowri
Hi, I have a service running somewhere which gives me JSON data. What I do is this: import urllib,urllib2 import cjson url = 'http://cmsdoc.cern.ch/cms/test/aprom/phedex/dev/gowri/datasvc/ tbedi/requestDetails' params = {'format':'json'} eparams = urllib.urlencode(params) request = urllib2.Reque