ElementTree ; change namespace

2009-10-07 Thread Benjamin Watine
Hello the list, I have question about ElementTree module, I didn't find a specific list so I post here. I hope I'm not wrong. I would like to know how to change the namespace URI of all the Element of my XML tree without changing anything else. I want that because I have to compare 2 XML

Re: Files application architecture

2008-09-08 Thread Benjamin Watine
Bruno Desthuilliers a écrit : Benjamin Watine a écrit : Hi, I'm about to develop a small python application and I wonder how to organize files in this application. I'm familar to java, so I'm tempted to use the same convention http://dirtsimple.org/2004/12/python-is-not-java.html : 1

Files application architecture

2008-09-05 Thread Benjamin Watine
Hi, I'm about to develop a small python application and I wonder how to organize files in this application. I'm familar to java, so I'm tempted to use the same convention : 1 file per class and 1 folders per package. I know that packages doesn't exists in python, they are modules instead.

Re: How to send a var to stdin of an external software

2008-03-25 Thread Benjamin Watine
Bryan Olson a écrit : Benjamin Watine wrote: [EMAIL PROTECTED] a écrit : I wrote: And here's a thread example, based on Benjamin's code: [...] Doh! Race condition. Make that: import subprocess import thread import Queue def readtoq(pipe, q): q.put(pipe.read

My python interpreter became mad !

2008-03-25 Thread Benjamin Watine
Yes, my python interpreter seems to became mad ; or may be it's me ! :) I'm trying to use re module to match text with regular expression. In a first time, all works right. But since yesterday, I have a very strange behaviour : $ python2.4 Python 2.4.4 (#2, Apr 5 2007, 20:11:18) [GCC 4.1.2

Re: My python interpreter became mad !

2008-03-25 Thread Benjamin Watine
John Machin a écrit : On Mar 25, 10:05 pm, Benjamin Watine [EMAIL PROTECTED] wrote: Yes, my python interpreter seems to became mad ; or may be it's me ! :) I'm trying to use re module to match text with regular expression. In a first time, all works right. But since yesterday, I have a very

Re: How to send a var to stdin of an external software

2008-03-17 Thread Benjamin Watine
[EMAIL PROTECTED] a écrit : I wrote: And here's a thread example, based on Benjamin's code: [...] Doh! Race condition. Make that: import subprocess import thread import Queue def readtoq(pipe, q): q.put(pipe.read()) cat = subprocess.Popen('cat',

Re: How to send a var to stdin of an external software

2008-03-14 Thread Benjamin Watine
Bryan Olson a écrit : I wrote: [...] Pipe loops are tricky business. Popular solutions are to make either the input or output stream a disk file, or to create another thread (or process) to be an active reader or writer. Or asynchronous I/O. On Unix-like systems, you can select() on the

How to send a var to stdin of an external software

2008-03-13 Thread Benjamin Watine
Hi the list, I need to send a var to stdin of an external soft (cat command for example). How can I do this ? I would like a function like that : theFunction ('cat -', stdin=myVar) I don't need to get any return value. Another related question : Is there's a limitation of var size ?

Re: How to send a var to stdin of an external software

2008-03-13 Thread Benjamin Watine
Marko Rauhamaa a écrit : Benjamin Watine [EMAIL PROTECTED]: How can I do this ? I would like a function like that : theFunction ('cat -', stdin=myVar) Another related question : Is there's a limitation of var size ? I would have var up to 10 MB. import subprocess myVar