[Tutor] Using xml.etree

2011-09-17 Thread lists
Hi Tutors, I have been trying to learn how to parse XML with Python and learn how to use xml.etree. Lots of the tutorials seem to be very long winded. I'm trying to access a UK postcode API at www.uk-postcodes.com to take a UK postcode and return the lat/lng of the postcode. This is what the XML

[Tutor] string formatting

2011-09-17 Thread Matthew Pirritano
All, I know that I can do this: "the %s is %s" % ('sky', 'blue') But I have very large blocks of text and I thought there was another way like X = "sky" Y = "blue" "the %(X)s is %(Y)s" But I've tried this and it is not working. I'm just trying to get it to work in the inter

Re: [Tutor] string formatting

2011-09-17 Thread Joel Goldstick
On Sat, Sep 17, 2011 at 7:51 PM, Matthew Pirritano < matthewpirrit...@sbcglobal.net> wrote: > All, > > ** ** > > I know that I can do this: > > ** ** > > "the %s is %s" % ('sky', 'blue') > > ** ** > > But I have very large blocks of text and I thought there was another way > like >

Re: [Tutor] string formatting

2011-09-17 Thread Sivan Orkin
On Sun, Sep 18, 2011 at 01:51, Matthew Pirritano < matthewpirrit...@sbcglobal.net> wrote: > All, > > ** ** > > I know that I can do this: > > ** ** > > "the %s is %s" % ('sky', 'blue') > > ** ** > > But I have very large blocks of text and I thought there was another way > like > >

Re: [Tutor] string formatting

2011-09-17 Thread Steven D'Aprano
Matthew Pirritano wrote: But I have very large blocks of text and I thought there was another way like X = "sky" Y = "blue" "the %(X)s is %(Y)s" Unless you use the string formatting operator %, strings containing "%" are just strings. Large or small, the way you do string formatting is with