Writing byte stream as jpeg format to disk

Robert Kern robert.kern at gmail.com
Thu Aug 26 23:45:04 CEST 2010


On 8/26/10 4:17 PM, Navkirat Singh wrote:

> 	#-------------HERE IS WHERE I RECEIVE THE DATA
> 	while True:
> 		buff = socket.recv(8192)
> 		byteStr +=buff
> 		if not buff: break

Also, you probably shouldn't bother writing an HTTP server using raw sockets. 
Use HTTPServer instead:

   http://docs.python.org/py3k/library/http.server.html

or better, wsgiref:

   http://docs.python.org/py3k/library/wsgiref.html

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list