On Thursday, July 11, 2013 8:25:13 PM UTC+8, F.R. wrote:
> On 07/11/2013 10:59 AM, F.R. wrote:
>
> > Hi all,
>
> >
>
> > I haven't been able to get up to speed with XML. I do examples from
>
> > the tutorials and experiment with variations. Time and time again I
>
> > fail with errors messag
On 07/11/2013 10:59 AM, F.R. wrote:
Hi all,
I haven't been able to get up to speed with XML. I do examples from
the tutorials and experiment with variations. Time and time again I
fail with errors messages I can't make sense of. Here's the latest
one. The url is "http://finance.yahoo.com/q?s=
On 11 Jul 2013 10:24, wrote:
>
> Actually, I don't think etree has a HTML parser. And I would
counter-recommend lxml if speed is an issue: BeautifulSoup takes a long
time to parse a large document.
>
> On Thursday, July 11, 2013 5:08:04 PM UTC+8, Fábio Santos wrote:
> >
> > Use an HTML parser.
Actually, I don't think etree has a HTML parser. And I would counter-recommend
lxml if speed is an issue: BeautifulSoup takes a long time to parse a large
document.
On Thursday, July 11, 2013 5:08:04 PM UTC+8, Fábio Santos wrote:
> On 11 Jul 2013 10:04, "F.R." wrote:
>
> >
>
> > Hi all,
>
On 11 Jul 2013 10:04, "F.R." wrote:
>
> Hi all,
>
> I haven't been able to get up to speed with XML. I do examples from the
tutorials and experiment with variations. Time and time again I fail with
errors messages I can't make sense of. Here's the latest one. The url is "
http://finance.yahoo.com/
Alain Ketterlin, 17.10.2012 08:25:
> It looks like you can't get the parent of an Element with elementtree (I
> would love to be proven wrong on this).
No, that's by design. ElementTree allows you to reuse subtrees in a
document, for example, which wouldn't work if you enforced a single parent.
Al
Tharanga Abeyseela writes:
> I need to remove the parent node, if a particular match found.
It looks like you can't get the parent of an Element with elementtree (I
would love to be proven wrong on this).
The solution is to find all nodes that have a Rating (grand-) child, and
then test explici
Hi,
note that it's best to reply to responses you get, rather than starting a
new thread on the same topic. It helps in building up context and in
keeping details together at one point in the archive for users who run into
similar problems later.
Tharanga Abeyseela, 17.10.2012 07:47:
> I need to
hello,
On Thu, Apr 28, 2011 at 07:57:28AM +0200, Stefan Behnel wrote:
> >So, I started change the codepage mark of xml:
> >
> > - same result
> > - same result
> > - same result
>
> You probably changed this in an editor that supports XML and thus
> saves the file in the declared encoding.
no
Hegedüs Ervin, 27.04.2011 21:33:
hello,
I'm using ElementTree to parse an XML file, but it stops at the
second record (id = 002), which contains a non-standard ascii
character, ä. Here's the XML:
The complaint offered up by the parser is
I've checked this xml with your script, I thi
On 4/27/2011 12:24 PM, Neil Cerutti wrote:
On 2011-04-27, Mike wrote:
I'm using ElementTree to parse an XML file, but it stops at the
second record (id = 002), which contains a non-standard ascii
character, ?. Here's the XML:
The complaint offered up by the parser is
Unexpected error
On 4/27/2011 12:33 PM, Hegedüs Ervin wrote:
hello,
I'm using ElementTree to parse an XML file, but it stops at the
second record (id = 002), which contains a non-standard ascii
character, ä. Here's the XML:
The complaint offered up by the parser is
I've checked this xml with your sc
hello,
> I'm using ElementTree to parse an XML file, but it stops at the
> second record (id = 002), which contains a non-standard ascii
> character, ä. Here's the XML:
>
>
>
>
>
>
>
>
>
>
> The complaint offered up by the parser is
I've checked this xml with your script, I think your l
On Apr 27, 2011, at 2:26 PM, Mike wrote:
> I'm using ElementTree to parse an XML file, but it stops at the second record
> (id = 002), which contains a non-standard ascii character, ä. Here's the XML:
>
>
>
>
>
>
>
>
>
>
> The complaint offered up by the parser is
>
> Unexpected error
On 2011-04-27, Mike wrote:
> I'm using ElementTree to parse an XML file, but it stops at the
> second record (id = 002), which contains a non-standard ascii
> character, ?. Here's the XML:
>
>
>
>
>
>
>
>
>
>
> The complaint offered up by the parser is
>
> Unexpected error opening simple_fail.xml:
On Wed, Apr 27, 2011 at 2:26 PM, Mike wrote:
> I'm using ElementTree to parse an XML file, but it stops at the second
> record (id = 002), which contains a non-standard ascii character, ä. Here's
> the XML:
>
>
>
>
>
>
>
>
>
>
> The complaint offered up by the parser is
>
> Unexpected erro
tekion writes:
> On Oct 3, 2:09 pm, de...@web.de (Diez B. Roggisch) wrote:
>> tekion writes:
>> > On Oct 2, 5:32 am, de...@web.de (Diez B. Roggisch) wrote:
>> >> tekion writes:
>> >> > All,
>> >> > I have the following xml tag:
>> >> >
>> >> >
>> >> > httpRequest
>> >> > HTTP://cm
On Oct 3, 2:09 pm, de...@web.de (Diez B. Roggisch) wrote:
> tekion writes:
> > On Oct 2, 5:32 am, de...@web.de (Diez B. Roggisch) wrote:
> >> tekion writes:
> >> > All,
> >> > I have the following xml tag:
> >> >
> >> >
> >> > httpRequest
> >> > HTTP://cmd.wma.ibm.com:80/
> >> >
tekion writes:
> On Oct 2, 5:32 am, de...@web.de (Diez B. Roggisch) wrote:
>> tekion writes:
>> > All,
>> > I have the following xml tag:
>> >
>> >
>> > httpRequest
>> > HTTP://cmd.wma.ibm.com:80/
>> > GET
>> > 200
>> >
>> >
>>
>> > I am interested in:
>> >
On Oct 2, 5:32 am, de...@web.de (Diez B. Roggisch) wrote:
> tekion writes:
> > All,
> > I have the following xml tag:
> >
> >
> > httpRequest
> > HTTP://cmd.wma.ibm.com:80/
> > GET
> > 200
> >
> >
>
> > I am interested in:
> > httpRequest
> > HTTP://cmd.
tekion writes:
> All,
> I have the following xml tag:
>
>
> httpRequest
> HTTP://cmd.wma.ibm.com:80/
> GET
> 200
>
>
>
> I am interested in:
>httpRequest
> HTTP://cmd.wma.ibm.com:80/
> GET
> 200
> as well as the upper layer tag. How do I ge
Thanks Robert Kern :
"prettyprint" ; indent() does the trick ;-)
>ElementTree writes exactly what you tell it to. In XML, whitespace is
>significant. If you want newlines and/or indentation to make it pretty-looking,
>then you need to add those to your elements.
>
>Fredrik provides an example f
On Thu, May 27, 2010 at 9:13 PM, Robert Kern wrote:
> ElementTree writes exactly what you tell it to. In XML, whitespace is
> significant. If you want newlines and/or indentation to make it
> pretty-looking, then you need to add those to your elements.
This is not always true. Let me quote an XML
On 5/27/10 7:52 PM, robert somerville wrote:
Hi I am using Ubuntu 9.10 and Python 2.6.4 ..
when I create an ElementTree object and the write it out using:
xml.etree.ElementTree.write() , I get one single long single line
files, instead of something that looks reasonable , what gives ??? (and
On Mar 10, 2010, at 6:48 PM, robert somerville wrote:
Hi ;
I installed the elementtree and celementree packages throught the
synaptic
package manager, all seems to go fine through the install ...
when i startup python and try to import them (as per the EFFBOTT.org
suggestions) .. PROBLEMS .
On Nov 5, 12:35 am, Stefan Behnel wrote:
> John Machin, 04.11.2009 02:56:
>
> > On Nov 4, 12:14 pm, Kee Nethery wrote:
> >> The reason I am confused is that getResponse2 is classified as an
> >> "str" in the Komodo IDE. I want to make sure I don't lose the non-
> >> ASCII characters coming from
John Machin, 04.11.2009 02:56:
> On Nov 4, 12:14 pm, Kee Nethery wrote:
>> The reason I am confused is that getResponse2 is classified as an
>> "str" in the Komodo IDE. I want to make sure I don't lose the non-
>> ASCII characters coming from the URL.
>
> str is all about 8-bit bytes.
True in P
On Nov 3, 2009, at 7:06 PM, Gabriel Genellina wrote:
En Tue, 03 Nov 2009 23:06:58 -0300, Kee Nethery
escribió:
If there was a place in the official docs for me to append these
nuggets of information to the sections for
"xml.etree.ElementTree.XML(text)" and
"xml.etree.ElementTree.dump(
En Tue, 03 Nov 2009 23:06:58 -0300, Kee Nethery escribió:
If there was a place in the official docs for me to append these nuggets
of information to the sections for "xml.etree.ElementTree.XML(text)" and
"xml.etree.ElementTree.dump(elem)" I would absolutely do so.
http://bugs.python.org/ a
On Nov 4, 1:06 pm, Kee Nethery wrote:
> On Nov 3, 2009, at 5:27 PM, John Machin wrote:
>
>
>
> > On Nov 4, 11:01 am, Kee Nethery wrote:
> >> Why is this not working and what do I need to do to use Elementtree
> >> with unicode?
>
> > What you need to do is NOT feed it unicode. You feed it a str
On Nov 4, 11:01 am, Kee Nethery wrote:
> Having an issue with elementtree XML() in python 2.6.4.
>
> This code works fine:
>
> from xml.etree import ElementTree as et
> getResponse = u'''
> bobblehead city>city'''
> theResponseXml = et.XML(getResponse)
>
> This code errors out
En Tue, 03 Nov 2009 21:01:46 -0300, Kee Nethery escribió:
Having an issue with elementtree XML() in python 2.6.4.
This code works fine:
from xml.etree import ElementTree as et
getResponse = u'''
bobbleheadcity>city'''
theResponseXml = et.XML(getResponse)
This code errors
On Nov 3, 2009, at 4:44 PM, Gabriel Genellina wrote:
En Tue, 03 Nov 2009 21:01:46 -0300, Kee Nethery
escribió:
I've removed all the stuff in my code and tried to distill it down
to just what is failing. Hopefully I have not removed something
essential.
Sounds like I did remove somethi
On Nov 3, 2009, at 5:27 PM, John Machin wrote:
On Nov 4, 11:01 am, Kee Nethery wrote:
Having an issue with elementtree XML() in python 2.6.4.
This code works fine:
from xml.etree import ElementTree as et
getResponse = u'''
bobbleheadcity'''
theResponseXml = et.XML(getRespo
On Nov 4, 12:14 pm, Kee Nethery wrote:
> On Nov 3, 2009, at 4:44 PM, Gabriel Genellina wrote:
>
> > En Tue, 03 Nov 2009 21:01:46 -0300, Kee Nethery
> > escribió:
>
> >> I've removed all the stuff in my code and tried to distill it down
> >> to just what is failing. Hopefully I have not remove
En Mon, 19 Oct 2009 17:02:44 -0300, Robert Kern
escribió:
On 2009-10-19 14:50 PM, Kee Nethery wrote:
Am looking for that level of documentation for each function, interface
and object listed in the official docs for elementtree.
Does it exist?
No.
Well, not so detailed, but the selftest.
On Oct 19, 2009, at 1:02 PM, Robert Kern wrote:
On 2009-10-19 14:50 PM, Kee Nethery wrote:
Am looking for that level of documentation for each function,
interface
and object listed in the official docs for elementtree.
Does it exist?
No.
Thank you.
Kee
--
http://mail.python.org/mailma
On 2009-10-19 14:50 PM, Kee Nethery wrote:
Am looking for that level of documentation for each function, interface
and object listed in the official docs for elementtree.
Does it exist?
No.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is
On Oct 19, 2009, at 12:06 PM, Paul Rubin wrote:
Kee Nethery writes:
do not appear to contain examples for each object, interface or
function. Where would I find examples that use each elementtree
function, interface and object?
effbot.org has a few.
yes I agree it has a few. It's not anyw
Kee Nethery writes:
> do not appear to contain examples for each object, interface or
> function. Where would I find examples that use each elementtree
> function, interface and object?
effbot.org has a few.
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 24, 7:29 pm, Dave Angel wrote:
> Stefan Behnel wrote:
> > Hi,
>
> > elsa wrote:
>
> >> I know how to turn HTML into an ElementTree object
>
> > I don't. ;)
>
> > ElementTree doesn't have an HTML parser, so what do you use for parsing?
>
> >> but I don't know
> >> how to then view the struct
On Aug 24, 12:13 am, Stefan Behnel wrote:
> Hi,
>
> elsa wrote:
> > I know how to turn HTML into an ElementTree object
>
> I don't. ;)
>
> ElementTree doesn't have an HTML parser, so what do you use for parsing?
The OP could be feeding the HTML through tidy, or it could be XHTML.
> > but I don'
Dave Angel wrote:
> Stefan Behnel wrote:
>> elsa wrote:
>>> I know how to turn HTML into an ElementTree object
>>
>> I don't. ;)
>>
>> ElementTree doesn't have an HTML parser, so what do you use for parsing?
>>
> Perhaps the OP was referring to XHTML, which should be eligible for
> ElementTree.
Stefan Behnel wrote:
Hi,
elsa wrote:
I know how to turn HTML into an ElementTree object
I don't. ;)
ElementTree doesn't have an HTML parser, so what do you use for parsing?
but I don't know
how to then view the structure of this object. Is there a method or
module that you can
Hi,
elsa wrote:
> I know how to turn HTML into an ElementTree object
I don't. ;)
ElementTree doesn't have an HTML parser, so what do you use for parsing?
> but I don't know
> how to then view the structure of this object. Is there a method or
> module that you can give an ElementTree object to
cmalmqui wrote:
> tree = etree.parse('10_07_2009 16_48_00_history.tcx')
> root = tree.getroot()
>
> elem = root[0][0]
>
> # iterate over all laps
> for i in range(1, len(elem)-1):
Note that you can iterate over elements as in
for lap_element in elem:
# ...
Then use
cmalmqui schrieb:
On Aug 11, 9:51 am, "Diez B. Roggisch" wrote:
cmalmqui schrieb:
Hi,
I am writing on a small XML parser and are currently stuck as I am not
able to get the whole element name in ElementTree.
Please see the below example where "print root[0][0]" returns
""
Is there a way to get
On Aug 11, 9:13 am, Ned Deily wrote:
> In article
> <1ad8dac1-8fff-493a-a197-d847e7b6a...@c2g2000yqi.googlegroups.com>,
>
> cmalmqui wrote:
> > I am writing on a small XML parser and are currently stuck as I am not
> > able to get the whole element name in ElementTree.
>
> > Please see the below
On Aug 11, 9:51 am, "Diez B. Roggisch" wrote:
> cmalmqui schrieb:
> > Hi,
>
> > I am writing on a small XML parser and are currently stuck as I am not
> > able to get the whole element name in ElementTree.
>
> > Please see the below example where "print root[0][0]" returns
> > ""
>
> > Is there a
cmalmqui schrieb:
Hi,
I am writing on a small XML parser and are currently stuck as I am not
able to get the whole element name in ElementTree.
Please see the below example where "print root[0][0]" returns
""
Is there a way to get hold of the "Running" string in the tag using
elementTree?
In article
<1ad8dac1-8fff-493a-a197-d847e7b6a...@c2g2000yqi.googlegroups.com>,
cmalmqui wrote:
> I am writing on a small XML parser and are currently stuck as I am not
> able to get the whole element name in ElementTree.
>
> Please see the below example where "print root[0][0]" returns
> ""
>
Hallöchen!
Stefan Behnel writes:
> Torsten Bronger wrote:
>
>> Stefan Behnel writes:
>>
>>> Torsten Bronger wrote:
>>>
[...]
My problem is that if there is only ASCII, these methods return
ordinary strings instead of unicode. So sometimes I get str,
sometimes I get unic
Torsten Bronger wrote:
> Hallöchen!
und zurück!
> Stefan Behnel writes:
>
>> Torsten Bronger wrote:
>>
>>> [...]
>>>
>>> My problem is that if there is only ASCII, these methods return
>>> ordinary strings instead of unicode. So sometimes I get str,
>>> sometimes I get unicode. Can one change
Hallöchen!
Stefan Behnel writes:
> Torsten Bronger wrote:
>
>> [...]
>>
>> My problem is that if there is only ASCII, these methods return
>> ordinary strings instead of unicode. So sometimes I get str,
>> sometimes I get unicode. Can one change this globally so that
>> they only return unicod
Torsten Bronger wrote:
> I parse an XML file with ElementTree and get the contets with
> the .attrib, .text, .get etc methods of the tree's nodes.
> Additionally, I use the "find" and "findtext" methods.
>
> My problem is that if there is only ASCII, these methods return
> ordinary strings instead
Aahz wrote:
> In article <4986bfd7$0$9385$ba4ac...@news.orange.fr>,
> m.banaouas wrote:
>> Working with the ElementTree module, I looked for clone element
>> function but not found such tool:
>
> Have you tried using copy.deepcopy()?
While being the most obvious solution, calling deepcopy() on a
In article <4986bfd7$0$9385$ba4ac...@news.orange.fr>,
m.banaouas wrote:
>
>Working with the ElementTree module, I looked for clone element
>function but not found such tool:
Have you tried using copy.deepcopy()?
--
Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/
We
En Mon, 02 Feb 2009 14:21:29 -0200, m.banaouas
escribió:
My python version is 2.4.4
def SubElement(parent, tag, attrib={}, **extra):
Can you tell me how does "parent" issue could be solved by SubElement ?
Simply because you *have* to pass a parent to the function...
I'm looking for how t
My python version is 2.4.4
def SubElement(parent, tag, attrib={}, **extra):
Can you tell me how does "parent" issue could be solved by SubElement ?
I'm looking for how to determine element parent just by asking element it self.
It seems like element doesn't know witch is its parent, while any par
Gabriel Genellina wrote:
En Mon, 02 Feb 2009 12:37:36 -0200, Gerard Flanagan
escribió:
e = ET.fromstring(s)
def clone(elem):
ret = elem.makeelement(elem.tag, elem.attrib)
ret.text = elem.text
for child in elem:
ret.append(clone(child))
return ret
f = clone(e)
En Mon, 02 Feb 2009 12:37:36 -0200, Gerard Flanagan
escribió:
e = ET.fromstring(s)
def clone(elem):
ret = elem.makeelement(elem.tag, elem.attrib)
ret.text = elem.text
for child in elem:
ret.append(clone(child))
return ret
f = clone(e)
You forget the tail attri
m.banaouas wrote:
Hi all,
Working with the ElementTree module, I looked for clone element function but not
found such tool:
def CloneElment(fromElem, destRoot = None)
fromElem is the element to clone
destRoot is the parent element of the new element ; if None so the new element
will be child of
Hunter wrote:
> We are reviewing a vendor who will output some data in an XML format.
> I will then use python to convert the data to another format for
> upload to another vendor.
Take a look at lxml.objectify, it has a nicer API, especially if you are new
to XML. It also handles loads of namespa
"Hunter" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
We are reviewing a vendor who will output some data in an XML format.
I will then use python to convert the data to another format for
upload to another vendor. I'm having trouble with very basic steps
with the sample file th
Mark Thomas wrote:
> here's how you would do it in lxml (http://codespeak.net/
> lxml/index.html), a library which supports XPath:
>
> from lxml import etree
> tree = etree.fromstring('Bar:')
> print ' '.join(tree.xpath('//text()'))
If you want to use XPath, try this:
print tree.xpath('s
Thank you very much Gabriel and Stefan for your help! I really appreciate the
excellent examples you've shared which is helping me understand how all this
works. Again, thank you for taking the time to help me with this.
Jay
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
>
>
>
>
>
>
>
>
>
>
>
>name="Courier">text
>
>
En Wed, 30 Jul 2008 00:56:55 -0300, <[EMAIL PROTECTED]> escribi�:
One other question I had was about rounding floats. I was first looking
at this syntax to round out to 6 decimal places if needed:
f = '508.5'
x = '%.6f' % (float(f)/72)
x
'7.062500'
However, in this instance I don't want t
J. Pablo Fernández wrote:
> Is ElementTree supposed to load DTDs?
AFAIR, you have to provide entities by hand.
> Or is there another library that would handle DTDs correctly,
> performing entity replacements?
http://codespeak.net/lxml
http://codespeak.net/lxml/parsing.html#parser-options
Stefa
Or is there another library that would handle DTDs correctly,
performing entity replacements?
Thanks.
On May 16, 12:20 am, J. Pablo Fernández <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Is ElementTree supposed to load DTDs? I have some xmls heavy on
> entities and it fails this way:
>
> Python 2.5.2
Mike Slinn wrote:
> The following short Python program parses a KML file and displays the
> names of all Marks and Routes:
>
> from elementtree.ElementTree import ElementTree
> tree = ElementTree(file='test.kml')
> kml = tree.getroot()
> ns = 'http://earth.google.com/kml/2.1'
> for folder in kml.f
On Jan 15, 5:22 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Peter Bengtsson wrote:
> > root = Element('feed', xmlns='http://www.w3.org/2005/Atom')
> > root.set('xmlns:se', NS_URL)
> > entry = SubElement(root, 'entry')
> > SubElement(root, 'title').text = 'Title'
> > SubElement(entry, SEN('catego
Hallöchen!
Fredrik Lundh writes:
> Peter Bengtsson wrote:
>
>> root = Element('feed', xmlns='http://www.w3.org/2005/Atom')
>> root.set('xmlns:se', NS_URL)
>> entry = SubElement(root, 'entry')
>> SubElement(root, 'title').text = 'Title'
>> SubElement(entry, SEN('category')).text = 'Category'
>
>>
Peter Bengtsson wrote:
> root = Element('feed', xmlns='http://www.w3.org/2005/Atom')
> root.set('xmlns:se', NS_URL)
> entry = SubElement(root, 'entry')
> SubElement(root, 'title').text = 'Title'
> SubElement(entry, SEN('category')).text = 'Category'
> But surely the xmlns:se attribute on the tag
Andrew Lonie wrote:
> Hi I noticed that the xpath functionality of elementtree has been
> upgraded in version 1.3. However I can't seem to get the [postion]
> predicate to function. All the other new functionality seems to be
> working.
ET 1.3 is only available in an early alpha yet, and the post
Stefan Behnel wrote:
>> also, putting large documents in a *single* Python string can be quite
>> inefficient. it's often more efficient to use lists of string fragments.
>
> That's a pretty general statement. Do you mean in terms of reading from that
> string (which at least in lxml is a straig
Fredrik Lundh wrote:
> Stefan Behnel wrote:
>
>>> My take on the API decision in question was always that a file is
>>> inherently an XML *document*, while a string is inherently an XML
>>> *fragment*.
>>
>> Not inherently, no. I know some people who do web processing with an XML
>> document comin
Stefan Behnel wrote:
>> My take on the API decision in question was always that a file is
>> inherently an XML *document*, while a string is inherently an XML
>> *fragment*.
>
> Not inherently, no. I know some people who do web processing with an XML
> document coming in as a string (from an HTTP
Hi,
Chris Mellon wrote:
> On that note, I really don't like APIs that take either a file name or
> a file object - I can open my own files, thanks.
... and HTTP URLs, and FTP URLs. In lxml, there is a performance difference
between passing an open file (which is read in Python space using the rea
On Jan 2, 2008 8:56 AM, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Steven D'Aprano wrote:
>
> > Fredrik, if you're reading this, I'm curious what your reason is. I don't
> > have an opinion on whether you should or shouldn't treat files and
> > strings the same way. Over to you...
>
> as Diez shows
Steven D'Aprano wrote:
> Fredrik, if you're reading this, I'm curious what your reason is. I don't
> have an opinion on whether you should or shouldn't treat files and
> strings the same way. Over to you...
as Diez shows, it's all about use cases.
and as anyone who's used my libraries or read
To answer something posted deep down... It is fine with me if there are two
functions - one to parse a file or file handler and one to parse a string,
yet the returned objects should be consistent.
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 01 Jan 2008 12:59:44 -0700, Steven Bethard wrote:
> Steven D'Aprano wrote:
>> On Tue, 01 Jan 2008 13:36:57 +0100, Diez B. Roggisch wrote:
>>
>>> And codemonkeys know that in python
>>>
>>> doc = et.parse(StringIO(string))
>>>
>>> is just one import away
>>
>> Yes, but to play devil's adv
Steven D'Aprano wrote:
> On Tue, 01 Jan 2008 13:36:57 +0100, Diez B. Roggisch wrote:
>
>> And codemonkeys know that in python
>>
>> doc = et.parse(StringIO(string))
>>
>> is just one import away
>
> Yes, but to play devil's advocate for a moment,
>
> doc = et.parse(string_or_file)
>
> would be
On Tue, 01 Jan 2008 13:36:57 +0100, Diez B. Roggisch wrote:
> And codemonkeys know that in python
>
> doc = et.parse(StringIO(string))
>
> is just one import away
Yes, but to play devil's advocate for a moment,
doc = et.parse(string_or_file)
would be even simpler.
Is there any reason why it
Steven D'Aprano schrieb:
> On Tue, 01 Jan 2008 01:53:47 +, Peter Pei wrote:
>
>> You are talking shit. It is never about whether it is hard to write a
>> wrapper. It is about bad design. I should be able to parse a string and
>> a file in exactly same way, and that should be provided as part o
Peter Pei wrote:
> To be preise
[...]
Preise the lord, not me. :)
Happy New Year!
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 01 Jan 2008 01:53:47 +, Peter Pei wrote:
> You are talking shit. It is never about whether it is hard to write a
> wrapper. It is about bad design. I should be able to parse a string and
> a file in exactly same way, and that should be provided as part of the
> package.
Oh my, somebod
To be preise, XPath is not fully supported. Don't be a smart asshole.
=
"Stefan Behnel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Peter Pei wrote:
>> One bad design about elementtree is that it has different wa
You are talking shit. It is never about whether it is hard to write a
wrapper. It is about bad design. I should be able to parse a string and a
file in exactly same way, and that should be provided as part of the
package.
Looks like you are just a code monkey not a designer, so I forgive you. Y
When dealing with files you pass it an object! So make your string an object
and then it should work!
On Dec 31, 2007 8:17 AM, Paddy <[EMAIL PROTECTED]> wrote:
> On Dec 31, 3:42 am, "Peter Pei" <[EMAIL PROTECTED]> wrote:
> > One bad design about elementtree is that it has different ways parsing a
Peter Pei wrote:
> One bad design about elementtree is that it has different ways parsing a
> string and a file, even worse they return different objects:
> 1) When you parse a file, you can simply call parse, which returns a
> elementtree, on which you can then apply xpath;
ElementTree doesn't su
On Dec 31, 3:42 am, "Peter Pei" <[EMAIL PROTECTED]> wrote:
> One bad design about elementtree is that it has different ways parsing a
> string and a file, even worse they return different objects:
> 1) When you parse a file, you can simply call parse, which returns a
> elementtree, on which you can
On Dec 13, 8:46 pm, Waldemar Osuch <[EMAIL PROTECTED]> wrote:
> On Dec 13, 7:52 pm, Sean DiZazzo <[EMAIL PROTECTED]> wrote:> I have a another
> question...
>
> > using elementtree, is there a proper way to get at the data
> > '123456789' in this tag?
>
> > ''
>
> > I tried making it an element, bu
On Dec 13, 7:52 pm, Sean DiZazzo <[EMAIL PROTECTED]> wrote:
> I have a another question...
>
> using elementtree, is there a proper way to get at the data
> '123456789' in this tag?
>
> ''
>
> I tried making it an element, but the only attribute that returns
> anything is the "tag" attribute. Does
[EMAIL PROTECTED] wrote:
> I tried the tips I found in other posts but I still get 'none' back:
>
> import easygui as eg
> import xml.etree.ElementTree as ET
> import sys
>
> #kml source is:
> #
> #http://earth.google.com/kml/2.2";>
> #
> #Simple placemark
> #Attached to the ground. Int
"Stefan Behnel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Tim Arnold wrote:
>> On a related note, I have another question--where/how can I get the
>> cElementTree.py module? Sorry for something so basic, but I tried
>> installing
>> cElementTree, but while I could compile wit
Tim Arnold wrote:
> On a related note, I have another question--where/how can I get the
> cElementTree.py module? Sorry for something so basic, but I tried installing
> cElementTree, but while I could compile with setup.py build, I didn't end up
> with a cElementTree.py file anywhere.
That's be
Tim Arnold wrote:
> On a related note, I have another question--where/how can I get the
> cElementTree.py module? Sorry for something so basic, but I tried installing
> cElementTree, but while I could compile with setup.py build, I didn't end up
> with a cElementTree.py file anywhere. The directo
"Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Thu, 25 Oct 2007 17:15:36 -0400, Tim Arnold wrote:
>
>> Hi, I'm getting the by-now-familiar error:
>> return codecs.charmap_decode(input,errors,decoding_map)
>> UnicodeEncodeError: 'ascii' codec can't enco
1 - 100 of 229 matches
Mail list logo