title: Facing issue while writing data into a file in python script
body: <p>I have to write 7231 bytes into a file using python script. In a client-server program, my python script act like client and it received 7231 bytes from server. If I check in TCP-Dump, its shows complete data. But when I try to write into a file; I am missing the content.</p>
  
  <p>My script:</p>
  
  <pre><code>   def SendOnce(self, req='/gpsData=1',method="GET"):
         conn = httplib.HTTPConnection(self.proxy)
         self.Logresponse("\nConnection Open\n&lt;br /&gt;")
         conn.request(method,req)
         Log="\nRequest Send: %s\n&lt;br \&gt;\n" %req
         self.Logresponse(Log)
         response = conn.getresponse()
         Log = "\nResponse Code: %s\n&lt;br \&gt;\n" %response.status
         self.Logresponse(Log)
         Log = "\nSarav -- Get Header: %s \n version= %s &lt;br \&gt;\n"           %(response.msg,response.version)
         self.Logresponse(Log)
         if (response.status==200):
             Log = response.read()
             self.Logresponse(Log)
         conn.close()
         self.Logresponse("\nConnection Close\n&lt;br \&gt;")
         return response
  </code></pre>
  
  <p>this "self.Logresponse(Log)" is writing into file. If i receive 1023 bytes, its writing full content into that. Please help me out how to write complete data.
  Note: I am writing Hexa Format data.</p>