From: Florian Lindner on 5 Mar 2007 15:13 Hello, I have a function from a library thast expects a file object as argument. How can I manage to give the function a string resp. have the text it would have written to file object as a string? Thanks, Florian
From: Arnaud Delobelle on 5 Mar 2007 15:23 On Mar 5, 8:13 pm, Florian Lindner <Florian.Lind...(a)xgm.de> wrote: > Hello, > I have a function from a library thast expects a file object as argument. > How can I manage to give the function a string resp. have the text it would > have written to file object as a string? > > Thanks, > > Florian See http://docs.python.org/lib/module-StringIO.html -- Arnaud
From: Paddy on 6 Mar 2007 13:31 On Mar 5, 8:13 pm, Florian Lindner <Florian.Lind...(a)xgm.de> wrote: > Hello, > I have a function from a library thast expects a file object as argument. > How can I manage to give the function a string resp. have the text it would > have written to file object as a string? > > Thanks, > > Florian You can also look at example 3 here: http://en.wikipedia.org/wiki/Doctest#Example_3:_unique_words.py - Paddy.
|
Pages: 1 Prev: Webserver balance load Next: JPype - passing to Java main |