Using Python2.7 version. Below is my sample code.
import StringIO
import sys
buff = StringIO.StringIO()
buff.write("hello")
print buff.read()
in the above program, read() returns me nothing where as getvalue() returns me "hello". Can anyone help me out in fixing the issue? I need read() because my following code involves reading "n" bytes.