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
""" | |
Convert an image to drawing instructions. | |
Dependencies: | |
* PIL, the Python Imaging Library | |
This basically write color values for each pixel, with minor cleverness to | |
reduce output size: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
"""A space-efficient frozen (write-once) mapping class. | |
A named map has two key properties: | |
1. The interface is like a dict. | |
2. Memory usage is like an object that defines __slots__. | |
Call namedmap.frozennamedmap() to define a subclass, passing the name | |
of the type and an iterable of key names. |
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
import BaseHTTPServer | |
import SimpleHTTPServer | |
import socket | |
class HTTPServer6(BaseHTTPServer.HTTPServer): | |
address_family = socket.AF_INET6 | |
if __name__ == '__main__': |