import stringcontents = "<grammar><ref id='bit'><para>0</para><para>1</para></ref></grammar>" import StringIO ssock = StringIO.StringIO(contents) print ssock.read() print ssock.read() print ssock.seek(0) print ssock.read(15) print ssock.read(15) print ssock.read() ssock.close()
Name (required)
email (will not be published) (required)
Website