How to use sys.stdout

Roman Kaminski romankaminski at lucent.com
Thu Nov 4 15:24:44 CET 2004


"Leon" <square690410 at yahoo.com.tw> wrote in message news:<cmclfi$cgm$1 at netnews.hinet.net>...
> what does it have properties ?
> what does it have method ?
> how to use they ? or where can find any information
> 
> please help me

An example:

s:/home/rkam>python
Python 2.3.3 (#1, May  3 2004, 20:19:41) 
[GCC 3.3.1] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> dir( sys.stdout)
['__class__', '__delattr__', '__doc__', '__getattribute__',
'__hash__', '__init_                  _', '__iter__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__setattr                 
__', '__str__', 'close', 'closed', 'encoding', 'fileno', 'flush',
'isatty', 'mod                  e', 'name', 'newlines', 'next',
'read', 'readinto', 'readline', 'readlines', 'se                  ek',
'softspace', 'tell', 'truncate', 'write', 'writelines', 'xreadlines']
>>> sys.stdout.write( 'hello world\n')
hello world
>>> 

http://www.python.org/doc/current/lib/module-sys.html

Good luck,
Roman Kaminski



More information about the Python-list mailing list