Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 198 results for
elementtree
- Page 1
Re: elementtree remove and appending
Programming
Software Development
16 Years Ago
by G-Do
… below:[CODE=python]import sys, xml.etree.
ElementTree
as ET # Create the root of the
ElementTree
from file root = ET.parse("…; # Now get the full tree from the root tree = ET.
ElementTree
(root) # And write to file! tree.write("out.xml…
Re: elementtree remove and appending
Programming
Software Development
16 Years Ago
by msaenz
… below:[CODE=python]import sys, xml.etree.
ElementTree
as ET # Create the root of the
ElementTree
from file root = ET.parse("…; # Now get the full tree from the root tree = ET.
ElementTree
(root) # And write to file! tree.write("out.xml…
elementtree remove and appending
Programming
Software Development
16 Years Ago
by msaenz
… and change it to 2009 (basically write to file with
elementtree
), except I do not know what is up with my…] import urllib import sys, string, os, datetime import xml.etree.
ElementTree
as ET root=ET.parse("thefile").getroot() iter…
ElementTree output format
Programming
Software Development
13 Years Ago
by pietromarchy
… guys, a not so complex question: [CODE] form xml.etree.
ElementTree
import * >>> tostring("<home><…
Re: ElementTree output format
Programming
Software Development
13 Years Ago
by Gribouillis
… which uses the (great) [icode]lxml[/icode] module instead of
ElementTree
. The lxml.etree.tostring() method accepts a 'pretty_print' keyword argument…
cx_freeze - ImportError with ElementTree
Programming
Software Development
12 Years Ago
by veelasong
… cx_freeze. [CODE] from xml.etree import
ElementTree
file1 = 'file1' file2 = 'file2' tree1 =
ElementTree
.parse(file1) tree2 =
ElementTree
.parse(file2) print 'Done' [/CODE] It….parse(source, parser) File "C:\Python27\lib\xml\etree\
ElementTree
.py", line 648, in parse parser = XMLParser(target=TreeBuilder…
ImportError: No Module Named ElementTree
Programming
Software Development
9 Years Ago
by abaddon2031
… have read says that my version of python should have
ElementTree
already installed on it. But every time i try to… 1, in <module> from
elementtree
.
ElementTree
import Element File "/home/hatterx/Desktop/
elementtree
.py", line 1, in <module…
Inheriting ElementTree
Programming
Software Development
13 Years Ago
by mbartz
…]from abc import ABCMeta, abstractmethod from xml.etree.
ElementTree
import
ElementTree
, Element, tostring class A(
ElementTree
): __metaclass__ = ABCMeta def __init__(self): pass @abstractmethod….py", line 4, in <module> class A(
ElementTree
): File "/System/Library/Frameworks/Python.framework/Versions/2.6…
Re: ImportError: No Module Named ElementTree
Programming
Software Development
9 Years Ago
by snippsat
Import is. >>> import xml.etree.
ElementTree
as ET >>> ET.VERSION '1.3.0' And you should not name file `
elementtree
.py`,it shall not be in desktop folder. This is a file in Pyhon library. For me only [Beautiful Soup](http://www.crummy.com/software/BeautifulSoup/bs4/doc/) or [lxml]( http://lxml.de/) for parsing.
Re: Inheriting ElementTree
Programming
Software Development
13 Years Ago
by Gribouillis
try [icode]class A(object,
ElementTree
)[/icode]
PyQt: Weird elementtree behavior
Programming
Software Development
13 Years Ago
by linuxoidoz
Hi, I'm trying to save
elementtree
back into an xml file and it bahaves really strange. … something wrong? Here's the code extract: [CODE] self.tree =
ElementTree
() self.xmlDoc = self.tree.parse(self.xmlFile) self.lstProperty = self…
Re: Iterating and removing an element from ElementTree
Programming
Software Development
14 Years Ago
by jlm699
… [URL="http://docs.python.org/library/xml.etree.
elementtree
.html#xml.etree.
ElementTree
.Element.remove"]documentation[/URL]: [QUOTE]Unlike the…
Re: Trouble with dictionary (from ElementTree parsed xml)
Programming
Software Development
11 Years Ago
by Gribouillis
… in this code import pickle import zipfile from xml.etree.
ElementTree
import
ElementTree
def load(zipname): with zipfile.ZipFile(zipname, 'r') as…
Iterating and removing an element from ElementTree
Programming
Software Development
14 Years Ago
by MaxVK
…> </category> </tree>[/CODE] I use
ElementTree
to parse this file and this works okay, however, I…
XML file using elementtree
Programming
Software Development
14 Years Ago
by shyami
Hi there, I am using
elementtree
to read xml, if xml file contains "-" i am getting error. Is it possible to read without any error? Plz give me code to read xml, if u have. Thanks -Shyami
XML - minidom/elementtree writing to file.
Programming
Software Development
12 Years Ago
by rmsagar
… share and ponder your thoughts. I tried both minidom and
ElementTree
, same result. [CODE] from xml.dom.minidom import parse dom…
Trouble with dictionary (from ElementTree parsed xml)
Programming
Software Development
11 Years Ago
by KoRnKloWn
… running into right now is this, I am using etree
ElementTree
to parse the xml files extracted from the .odt file…
add entries to XML file using elementtree
Programming
Software Development
10 Years Ago
by krystosan
…(self): path = self.modulePath root = Element("modules") tree =
ElementTree
(root) childPath = Element("module") childPath.set("name…
using xml.etree with XML files containing a '€' symbol
Programming
Software Development
11 Years Ago
by jakehardy
…, parser) File "C:\Python27\lib\xml\etree\
ElementTree
.py", line 653, in parse parser.feed(data…) File "C:\Python27\lib\xml\etree\
ElementTree
.py", line 1624, in feed self._raiseerror(v…) File "C:\Python27\lib\xml\etree\
ElementTree
.py", line 1488, in _raiseerror raise err ParseError…
Re: using xml.etree with XML files containing a '€' symbol
Programming
Software Development
11 Years Ago
by Gribouillis
It works for me with python 2.7.2 in linux. You could try this from xml.etree import
ElementTree
as ET from xml.etree.
ElementTree
import XMLParser parser = XMLParser(encoding="utf-8") optionstree = ET.parse("test.conf", parser=parser)
Reading XML data
Programming
Software Development
15 Years Ago
by adam291086
… [CODE]#!/usr/bin/env python from xml.etree import
ElementTree
as ET try: tree = ET.parse('/Users/adamplowman/… [CODE]#!/usr/bin/env python from xml.etree import
ElementTree
as ET def main(): element = ET.XML("&…/05/07/elegant-xml-parsing-using-the-
elementtree
-module/#ReadingfromtheWeb[/url] any help is appreciated
Specifying Proxy using urllib2
Programming
Software Development
13 Years Ago
by python |
… particular account. [CODE] try: from xml.etree import
ElementTree
except ImportError: from
elementtree
import
ElementTree
import gdata.spreadsheet.service import gdata.service import…
Generating XML
Programming
Software Development
13 Years Ago
by tcl76
… Python 2.5 and Win XP. My code: [CODE] import
elementtree
.
ElementTree
as ET lspeed=2 tspeed=3 f=open("out…, "Target Speed") title.text = str(tspeed) tree = ET.
ElementTree
(root) xml.write(title) tree.write("C:\\Python25\\myscript…
Downloading the file and cancel it
Programming
Software Development
9 Years Ago
by mark103
…as database from xml.etree import
ElementTree
import xml.etree.
ElementTree
as ET from UserDict import DictMixin… description TEXT)') con.commit() con.close tv_elem =
ElementTree
.parse(StringIO.StringIO(data)).getroot() profilePath = xbmc.translatePath(…
Re: Reading XML data
Programming
Software Development
15 Years Ago
by adam291086
… script [code] #!/usr/bin/env python from xml.etree import
ElementTree
as ET import os import urllib feed = urllib.urlopen("…
Printing out a dictionary value
Programming
Software Development
15 Years Ago
by adam291086
… way here is the code [CODE]#!/usr/bin/python import
elementtree
.
ElementTree
as ET import urllib import MySQLdb print "Content-type…
How can I read XML to retrieve values of tags?
Programming
Software Development
11 Years Ago
by ryan461
…, IP, or nexthop. I've been playing with xml.etree.
ElementTree
but no luck so far. Tried different things with forloops… cant really reference them later. ie: from xml.etree import
ElementTree
as ET routetable = ET.parse('RoutingTable.xml') for route in…
problem with loops
Programming
Software Development
10 Years Ago
by mark103
… import dbapi2 as database from xml.etree import
ElementTree
class Channel: def __init__(self): self.__display_name …TIMESTAMP, description TEXT)') con.commit() con.close tv_elem =
ElementTree
.parse(StringIO.StringIO(data)).getroot() channels = {} for elem…
how to print the title from xml source
Programming
Software Development
9 Years Ago
by mark103
… as database from xml.etree import
ElementTree
from UserDict import DictMixin import datetime … TEXT)') con.commit() con.close tv_elem =
ElementTree
.parse(StringIO.StringIO(data)).getroot() profilePath = xbmc…
Troubleshooting utility to parse XML objects
Programming
Software Development
8 Years Ago
by Saran_1
…library import sys from parsexml2 import flatten_dict,
ElementTree
import csv # The class name class….replace('�', '') #optional to remove ampersands. root =
ElementTree
.XML(xml_string) for item in root: print(root)…
1
2
3
4
Next
Last
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Meet People
Forums
Top Members
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC