473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

XML Writer in wxPython

Have you ever write an XML Writer in wxPython? A Writer that from a GUI
can compose XML Files.
Thanks.
Marco.

Jan 12 '06 #1
7 1594
On 1/12/06, Marco Meoni <me********@gmail.com> wrote:
I'm building a GUI of a network manager that send its commands in xml files.
I would can write xml files from GUI (that is in wxPython). Have you
understand from my "spaghetti" english?


Yes, your English is fine. Much better than my Italian! :)

Sounds like you could use the xml.dom.minidom module
(http://www.python.org/doc/current/li....minidom.html).
On that page they have information for creating new XML documents.

--

# p.d.
Jan 13 '06 #2
"Marco Meoni" <me********@gmail.com> wrote:

Have you ever write an XML Writer in wxPython? A Writer that from a GUI
can compose XML Files.


XML is usually pretty easy to write by hand, just using print statements.
Do you alreday have a tree of objects you want to write?
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jan 14 '06 #3
Could you post an example please?
Thanks!

Jan 16 '06 #4
"Marco Meoni" <me********@gmail.com> wrote:

Could you post an example please?


Not really; it depends on what it is you're writing.
def PrintAddress( last, first, address, city, state, zip ):
print " <address>"
print " <lastname>%s</lastname>" % last
print " <firstname>%s</firstname>" % first
print " <address1>%s</address1>" % address
print " <city>%s</city>" % city
print " <state>%s</state>" % state
print " <zip>%s</zip>" % zip
print " </address>"

print "<addresses>"
for row in addressDatabase:
PrintAddress( row.last, row.first,
row.address, row.city, row.state, row.zip )
print "</addresses>"
You can see how an HTML templating aid could help here.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jan 18 '06 #5
i have to put the XML in a string. Is there a module with the XML
writing funcion?

Jan 18 '06 #6
Tim Roberts wrote re using print to generate XML:
def PrintAddress( last, first, address, city, state, zip ):
print " <address>"
print " <lastname>%s</lastname>" % last
print " <firstname>%s</firstname>" % first
print " <address1>%s</address1>" % address
print " <city>%s</city>" % city
print " <state>%s</state>" % state
print " <zip>%s</zip>" % zip
print " </address>"

print "<addresses>"
for row in addressDatabase:
PrintAddress( row.last, row.first,
row.address, row.city, row.state, row.zip )
print "</addresses>"


Just be sure you're well aware of all the issues:

http://www.xml.com/pub/a/2002/11/13/py-xml.html

See also:

http://www.ibm.com/developerworks/xm...x-think35.html

--
Uche Ogbuji Fourthought, Inc.
http://uche.ogbuji.net http://fourthought.com
http://copia.ogbuji.net http://4Suite.org
Articles: http://uche.ogbuji.net/tech/publications/

Feb 7 '06 #7
Tim Roberts wrote re using print to generate XML:
def PrintAddress( last, first, address, city, state, zip ):
print " <address>"
print " <lastname>%s</lastname>" % last
print " <firstname>%s</firstname>" % first
print " <address1>%s</address1>" % address
print " <city>%s</city>" % city
print " <state>%s</state>" % state
print " <zip>%s</zip>" % zip
print " </address>"

print "<addresses>"
for row in addressDatabase:
PrintAddress( row.last, row.first,
row.address, row.city, row.state, row.zip )
print "</addresses>"


Just be sure you're well aware of all the issues:

http://www.xml.com/pub/a/2002/11/13/py-xml.html

See also:

http://www.ibm.com/developerworks/xm...x-think35.html

--
Uche Ogbuji Fourthought, Inc.
http://uche.ogbuji.net http://fourthought.com
http://copia.ogbuji.net http://4Suite.org
Articles: http://uche.ogbuji.net/tech/publications/

Feb 7 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: SeeBelow | last post by:
Do many people think that wxPython should replace Tkinter? Is this likely to happen? I ask because I have just started learning Tkinter, and I wonder if I should abandon it in favor of...
25
by: BJörn Lindqvist | last post by:
See: http://www.wxpython.org/quotes.php. especially: "wxPython is the best and most mature cross-platform GUI toolkit, given a number of constraints. The only reason wxPython isn't the standard...
1
by: timothy.williams | last post by:
I'm trying to install wxPython 2.5.3.1 using Python 2.3.2 on a Fedora 2 machine. I have python in a non-standard place, but I'm using --prefix with the configure script to point to where I have...
1
by: James Stroud | last post by:
Hello All, I will soon have an excuse to install a new operating system on my computer. I would like to know exactly what operating system I should have so that I can get wxPython going....
17
by: PyPK | last post by:
Hi I am looking for a simple tiff Image reader/writer in python.Can anyone point me to the right one.
25
by: TPJ | last post by:
GUI's etc: PyGtk on Windows "(...) So if someone develops mainly for X and just wants to make sure that it is not impossible to run on Windows, you can use PyGTK. (...)", July 2nd, 1999 pyGTK...
0
by: Robin Dunn | last post by:
Announcing ---------- The 2.6.3.0 release of wxPython is now available for download at http://wxpython.org/download.php. There have been many enhancements and fixes implemented in this...
0
by: Robin Dunn | last post by:
Announcing ---------- The 2.6.3.0 release of wxPython is now available for download at http://wxpython.org/download.php. There have been many enhancements and fixes implemented in this...
4
by: stef | last post by:
hello, I'm trying to move from Delphi to Python (move from MatLab to Python already succeeded, also thanks to this discussion group). From the discussions in this list about "the best" GUI for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.