A question about python and xml

J. Cliff Dyer jcd at sdf.lonestar.org
Fri May 9 12:08:17 EDT 2008


On Fri, 2008-05-09 at 08:39 -0700, Holden wrote:
> Hello everyone I heard this was a good community to go too for help
> and advice. I want to make a web site that uses the python programming
> language which I am VERY new at. This website would store simple data
> such as names in a form. At first I wanted to use mysql to store the
> data but I want to export the data using xml.
> 
> So say if a user logged in they would be able to store there basic
> information in an xml file and download it whenever. Is that possible
> using XML and Python. I am sorry if this post doesn't make much sense
> but any advice would be greatly appreciated. You can also e-mail me if
> you need further information or clarification.
> 
> Thanks
> 
> Holden
> --
> http://mail.python.org/mailman/listinfo/python-list
> 

A general question will only get you a general answer, but yes, it's
very possible.  

You'll want to look into the cgi module (in the standard library)for
basic, ground level server/browser communication.  You might also be
interested in using a web framework, for keeping your site design clean
and manageable.  I recommend Django from my own experience, but you
might also look into turbogears, pylons, webpy, or any of a number of
other well-regarded options.  The downside to using a framework is that
it's another set of things to learn, which, if you're just starting out
with python, might be a bit much to chew, but they can be very helpful
with maintenance down the line.

For XML processing, lxml.etree or ElementTree should suit your needs.
ElementTree is included in the standard library of recent versions of
python, though lxml is easily downloadable, and adds a couple bells and
whistles.  There are other options available, but those are
straightforward to use, and well designed.

Good luck with your site.

Cheers,
Cliff





More information about the Python-list mailing list