On Jan 15, 12:44 pm, "Ben Fisher" <[EMAIL PROTECTED]> wrote:
> This might have something to do with the class being derived from file.
>
> I've written it so that it doesn't derive from file, and it works.
>
> class File_and_console():
> def __init__(self, *args):
> self.fileobj = open(*args)
> def write(self, s):
> self.fileobj.write(s)
> print s,
>
> f = File_and_console('testout.tmp','w')
> f.write('hello')
> print >>f,'hello',
>
Thanks, but that's what I tried first. Then I though it would be nice
if I could just inherit from 'file' and implement this with less code.
--
http://mail.python.org/mailman/listinfo/python-list