This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def chunks(l, n): | |
""" Yield successive n-sized chunks from l. | |
http://stackoverflow.com/a/312464/1572077 | |
""" | |
for i in xrange(0, len(l), n): | |
yield l[i:i+n] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
import SimpleHTTPServer | |
import SocketServer | |
import logging | |
PORT = 8000 | |
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): |