vagueish questions on use of file/string objects

Keith Keller kkeller at speakeasy.net
Tue Jan 29 02:11:42 EST 2002


In article <eQq58.23574$8b.950210 at atlpnn01.usenetserver.com>,
	"Steve Holden" <sholden at holdenweb.com> writes:
> "Keith Keller" <kkeller at speakeasy.net> wrote in message
>> ==Create a fake file object that's not on disk, and pass it to the
>> nntplib post method.  I looked all over the place for docs on how to do
>> this, but couldn't find anything helpful.  Either I'm clueless, the
>> docs are buried, or they don't exist.

> All your approaches seem quite reasonable, but your penultimate paragraph
> hits the nail precisely on the head. Pythonistas talk about "file-like
> objects", the most convenient of which would, for your purposes, probably be
> found in the StringIO module. Faster versions are found in cStringIO.

Cripes, there it is!  I guess it's a combination of clueless and
buried docs.  :)  Thanks much for the pointer, c/StringIO looks perfect.

--keith

-- 
kkeller at speakeasy.net
public key:  http://wombat.san-francisco.ca.us/kkeller/public_key
alt.os.linux.slackware FAQ:  http://wombat.san-francisco.ca.us/perl/fom




More information about the Python-list mailing list