Module cStringIO :: Class OutputType
[hide private]
[frames] | no frames]

type OutputType

object --+
         |
        OutputType

Simple type for output to strings.

Instance Methods [hide private]
 
__iter__(x)
iter(x)
 
close(...)
close(): explicitly release resources held.
 
flush(...)
flush(): does nothing.
 
getvalue(use_pos=...)
Get the string value.
 
isatty(...)
isatty(): always returns 0
the next value, or raise StopIteration
next(x)
 
read(s=...)
Read s characters, or the rest of the string
 
readline()
Read one line
 
readlines()
Read all lines
 
reset()
Reset the file position to the beginning
 
seek(position)
set the current position seek(position, mode) -- mode 0: absolute; 1: relative; 2: relative to EOF
 
tell()
get the current position.
 
truncate(...)
truncate(): truncate the file at the current position.
 
write(s)
Write a string to the file
None
writelines(sequence_of_strings)
Write the strings to the file.
Properties [hide private]
  closed
True if the file is closed
  softspace
flag indicating that a space needs to be printed; used by print
Method Details [hide private]

getvalue(use_pos=...)

 

Get the string value. If use_pos is specified and is a true value, then the string returned will include only the text up to the current file position.

write(s)

 

Write a string to the file

Note (hack:) writing None resets the buffer

writelines(sequence_of_strings)

 

Write the strings to the file.

Note that newlines are not added. The sequence can be any iterable object producing strings. This is equivalent to calling write() for each string.

Returns: None