Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1b - Decimal:
27
| #!/usr/bin/env python | |
| import BaseHTTPServer, SimpleHTTPServer | |
| import ssl | |
| import sys | |
| import argparse | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument('--certfile') | |
| ap.add_argument('--keyfile') | |
| ap.add_argument('--port', type=int, default=443) |
| import string | |
| def hexdump(src, length=16, sep='.'): | |
| DISPLAY = string.digits + string.letters + string.punctuation | |
| FILTER = ''.join(((x if x in DISPLAY else '.') for x in map(chr, range(256)))) | |
| lines = [] | |
| for c in xrange(0, len(src), length): | |
| chars = src[c:c+length] | |
| hex = ' '.join(["%02x" % ord(x) for x in chars]) | |
| if len(hex) > 24: |