[Tutor] Python & XML
Isr Gish
isrgish at fastem.com
Sun May 9 11:56:14 EDT 2004
Don't know anything about XML. But just wanted to mention that it's not advisable to assign anything to a built-in function name, or keyward. The line:
print = '\t\tPSETI'
is doing just that. "print" is a built in keyword.
All the best
Isr
-----Original Message-----
>From: "justinstraube at charter.net"<justinstraube at charter.net>
>Sent: 5/6/04 7:21:36 PM
>To: "tutor at python.org"<tutor at python.org>
>Subject: [Tutor] Python & XML
>
>Hello,
>
>Ive used the httplib module and the examples given in the 2.3 docs to
>retrieve my or a given users stats from SETI,
>
>http://setiathome2.ssl.berkeley.edu/fcgi-
>bin/fcgi?cmd=user_xml&email=XXXX
>(where XXXX is the registered email address)
>
>The string retrieved is in XML format. Ive begun looking at the some of
>the docs for the different XML modules in 2.3 but this is a bit
>confusing. Im not sure where to start.
>
>I am guessing that this should be a fairly simple project as the tags
>for the fields in the user stats shouldnt change. I would just need to
>extract the wanted data for display.
>
>Can anyone can point me to anything on how to go about this?
>
>####
>import httplib
>
>SETI = "setiathome2.ssl.berkeley.edu"
>
>print = '\t\tPSETI'
>usrmail = raw_input('\nYour Email Address: ')
>addr = '/fcgi-bin/fcgi?cmd=user_xml&email=' + usrmail
>
>conx = httplib.HTTPConnection(SETI)
>conx.request('GET', addr)
>response = conx.getresponse()
>print response.status, response.reason
>data = response.read()
>conx.close()
>print data
>
>raw_input('Press Enter to continue')
>####
>
>
>Thanks,
>
>Justin
>
>---
>
>
>_______________________________________________
>Tutor maillist - Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor
More information about the Tutor
mailing list