Re: [Tutor] Python XML for newbie

2012-07-01 Thread David Kidd
On Mon, Jul 2, 2012 at 12:31 PM, Sean Carolan wrote: > How do you say, "If the field is 11, then print the next value"? The > raw XML looks like this: > > > 1 > 11 > 9780470286975 > > Instead of iterating over the whole tree, grab all the elements then retrieve the child, check the field va

Re: [Tutor] ASCII Conversion

2012-01-30 Thread David Kidd
On Tue, Jan 31, 2012 at 15:50, Michael Lewis wrote: > ... However, if I pass in a string, it's converted to ASCII and will > still satisfy the if statement and print out value. How do I ensure that a > string is caught as a ValueError instead of being converted? It depends on what you want to do