ElementTree : parse string input

2006-07-06 Thread rajarshi . guha
Hi, recently having discovered ElementTree I'm stumped by a very simple problem, which I can't find the answer to. I have some XML in a string object. Now the parse() method of ElementTree takes a filename or file-like object. So I tried creating a StringIO object from the original string and then

Re: iterate over a series of nodes in an XML file

2006-07-05 Thread rajarshi . guha
Stefan Behnel wrote: > [EMAIL PROTECTED] wrote: > > I have an XML file which contains entries of the form: > > > > > > 1 > > 2 > > > > 1 > > Thanks to everybody for the pointers. ElementTree is what I ended up using and my looks like this (based on the ElementTree tutorial code):

iterate over a series of nodes in an XML file

2006-07-05 Thread rajarshi . guha
Hi, I have an XML file which contains entries of the form: 1 2 1 Currently, I have written a SAX based handler that will read in all the entries and return a list of the contents of these entries. However this is not scalable and for my purposes it would be better if I could iterat

packaging a python project and associated graphics files

2005-10-03 Thread Rajarshi Guha
Hi, I've been trying to package a python project and I'm a little confused about how I distribute some PNG's that the program uses as icons. Using distutils I can set the data_files argument of setup() and get my data files located in, say, /usr/local/mydata. However when I write my code, it woul

accesing pages (or ranges of pages) via Reportlab

2005-04-18 Thread Rajarshi Guha
Hi, I've been using pdflatex to dump ranges of pages from a PDF file via Python. However, I was looking at the Reportlab toolkit and was wondering if this operation would be possible using this toolkit as well. Admittedly, I have'nt read the documentation in detail, but I was wondering if anybody