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 sys, socket, select, errno | |
from tornado import ioloop, iostream | |
### Main Program | |
def main(kind=None): | |
if not kind or kind not in ('Original', 'Modified'): | |
usage() |
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 python | |
"""ply-path -- analysis of an path expression using PLY | |
Example: ply-path.py 'child::para[position()>1]' | |
""" | |
import sys | |
from ply import lex |
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
"""starttls -- an example of wrapping a non-blocking socket with TLS. | |
Example: | |
> openssl req -new -x509 -days 365 -nodes -out /tmp/cert.crt -keyout /tmp/cert.key | |
> python /path/to/this-file.py | |
starting client: 7 | |
starting server: 8 | |
client said: 'hello'. | |
server said: "YOU SAID: 'hello'". |
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
## An example of using lxml as a namespace-aware, event-based push | |
## parser. | |
import urllib2 | |
from contextlib import closing | |
from lxml import etree | |
class Target(object): | |
def start(self, tag, attr): |
NewerOlder