PLY is a wonderful toolkit. I used it to write a compiler for ice9 (some made up language used for teaching) that compiled down to JVM bytecode (using Jasmin) for my compilers class.
See the code here: https://github.com/mdwrigh2/pyice
See the code here: https://github.com/mdwrigh2/pyice
http://www.boriel.com/software/the-zx-basic-compiler/?lang=e...