Re: [Tutor] Using xml.etree

2011-09-19 Thread lists
Hello again. So, any xml.etree experts out there who might have missed this over the weekend? Thanks in advance! Chris ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Using xml.etree

2011-09-19 Thread Tim Golden
On 19/09/2011 10:46, lists wrote: Hello again. So, any xml.etree experts out there who might have missed this over the weekend? Not me, I'm afraid, but might I suggest that you ask on the mail Python list: http://mail.python.org/mailman/listinfo/python-list There's nothing wrong with

Re: [Tutor] Using xml.etree

2011-09-19 Thread Tim Golden
On 19/09/2011 11:01, Tim Golden wrote: you're more likely to find people familiar with the package (including its maintainer in fact...) Sorry, I misread your post and thought you were referring lxml.etree (which is a 3rd-party lib). My basic point still stands, though: you'll get more

Re: [Tutor] Using xml.etree

2011-09-19 Thread lists
Thanks Tim, Will do. Chris On Mon, Sep 19, 2011 at 11:05 AM, Tim Golden m...@timgolden.me.uk wrote: On 19/09/2011 11:01, Tim Golden wrote: you're more likely to find people familiar with the package (including its maintainer in fact...) Sorry, I misread your post and thought you were

[Tutor] How it is better than java

2011-09-19 Thread Ashish Gaonker
My obvious thinking is : Java being compiled language , must be faster then a interpreted language. I know couple of points : Development time is less + easy to learn + python is expressive. Can you share some more especially as compared to Java / .net (two primarily used languages in

Re: [Tutor] How it is better than java

2011-09-19 Thread Christian Witts
On 2011/09/19 03:27 PM, Ashish Gaonker wrote: My obvious thinking is : Java being compiled language , must be faster then a interpreted language. I know couple of points : Development time is less + easy to learn + python is expressive. Can you share some more especially as compared to

Re: [Tutor] How it is better than java

2011-09-19 Thread Walter Prins
Hi Ashish, On 19 September 2011 14:27, Ashish Gaonker ashish@gmail.com wrote: My obvious thinking is : Java being compiled language , must be faster then a interpreted language. I know couple of points : Development time is less + easy to learn + python is expressive. Can you share

Re: [Tutor] string formatting

2011-09-19 Thread Pirritano, Matthew
Pythonistas, This is the resolution of a question I asked over the weekend. The method I was thinking of was in a program I wrote on my work computer but couldn't remember. Now I'm at work and I see. It is not including the tuple at the end of the string nor using a dictionary. There is

Re: [Tutor] string formatting

2011-09-19 Thread Wayne Werner
On Mon, Sep 19, 2011 at 10:46 AM, Pirritano, Matthew mpirrit...@ochca.comwrote: snip You some variables say: X = sky Y = blue Print the %(x)s is %(y)s % locals() the sky is blue That works! And in cases where I'm replacing over 20 strings it's much easier than having to include a

Re: [Tutor] string formatting

2011-09-19 Thread bodsda
Is there any additional overhead of using the locals() or format(locals()) instead of a tuple? - the format option is a double function call so I would expect that to be considerably slower Thanks, Bodsda -- my phone won't let me bottom post, sorry Sent from my BlackBerry® wireless device

Re: [Tutor] string formatting

2011-09-19 Thread Wayne Werner
On Mon, Sep 19, 2011 at 1:11 PM, bod...@googlemail.com wrote: Is there any additional overhead of using the locals() or format(locals()) instead of a tuple? - the format option is a double function call so I would expect that to be considerably slower Using the following code and timeit, it

[Tutor] OptionParser

2011-09-19 Thread Mina Nozar
Hello, I am trying to use OptionParser (my first time) to set a variable (cvs_output). i.e. if --csv is given in the list of options, then cvs_output = True. Then I check, if cvs_output == True: [...] I have the following so far but something is missing. from optparse import OptionParser

Re: [Tutor] OptionParser

2011-09-19 Thread Wayne Werner
On Mon, Sep 19, 2011 at 1:22 PM, Mina Nozar noz...@triumf.ca wrote: ** I don't really understand what dest and action in the arguments to parser.add_option mean. Any help is appreciated. Have you read the fine manual, specifically the sections here:

Re: [Tutor] Using xml.etree

2011-09-19 Thread Sander Sweers
On 17/09/11 13:08, lists wrote: 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

Re: [Tutor] Using xml.etree

2011-09-19 Thread lists
On Mon, Sep 19, 2011 at 9:20 PM, Sander Sweers sander.swe...@gmail.com wrote: On 17/09/11 13:08, lists wrote: 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

[Tutor] iretator.send

2011-09-19 Thread Christopher King
Dear tutor dudes, I know that a for loop uses a an iterators next method in this way for variable in iterator: execute_code(variable) is equivalent to while True: try: variable = iterator.next() except StopIteration: break else: execute_code(variable)

Re: [Tutor] iretator.send

2011-09-19 Thread Steven D'Aprano
Christopher King wrote: Is there any syntax that uses the send method of an iterator? No. -- Steven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How it is better than java

2011-09-19 Thread Steven D'Aprano
Ashish Gaonker wrote: My obvious thinking is : Java being compiled language , must be faster then a interpreted language. There are three misunderstandings with that statement. Firstly: Languages are neither compiled or interpreted. Languages are syntax and grammar. Implementations are

Re: [Tutor] string formatting

2011-09-19 Thread Steven D'Aprano
Wayne Werner wrote: On Mon, Sep 19, 2011 at 1:11 PM, bod...@googlemail.com wrote: Is there any additional overhead of using the locals() or format(locals()) instead of a tuple? - the format option is a double function call so I would expect that to be considerably slower Using the following