streaming

Writing a Python Music Streamer

Writing a Python Music Streamer Question: I would like to implement a server in Python that streams music in MP3 format over HTTP. I would like it to broadcast the music such that a client can connect to the stream and start listening to whatever is currently playing, much like a radio station. Previously, I’ve …

Total answers: 5

How to stream an HttpResponse with Django

How to stream an HttpResponse with Django Question: I’m trying to get the ‘hello world’ of streaming responses working for Django (1.2). I figured out how to use a generator and the yield function. But the response still not streaming. I suspect there’s a middleware that’s mucking with it — maybe ETAG calculator? But I’m …

Total answers: 2

Stream large binary files with urllib2 to file

Stream large binary files with urllib2 to file Question: I use the following code to stream large files from the Internet into a local file: fp = open(file, ‘wb’) req = urllib2.urlopen(url) for line in req: fp.write(line) fp.close() This works but it downloads quite slowly. Is there a faster way? (The files are large so …

Total answers: 4