Re: Using string as file

2007-03-06 Thread Paddy
On Mar 5, 8:13 pm, Florian Lindner [EMAIL PROTECTED] 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.

-- 
http://mail.python.org/mailman/listinfo/python-list


Using string as file

2007-03-05 Thread Florian Lindner
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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Using string as file

2007-03-05 Thread Arnaud Delobelle
On Mar 5, 8:13 pm, Florian Lindner [EMAIL PROTECTED] 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

-- 
http://mail.python.org/mailman/listinfo/python-list