zc.customdoctests provides a little bit of help with creating custom doctest parsers that work pretty muct like regular doctests, but that use an alternate means of evaluating examples. To use it, you call zc.customdoctests.DocTestParser and pass any of the following options:
The first-line prompt, which defaultd to '>>>'.
This must be a regular expression that matches exactly 3 characters.
(Note that you can’t override the second-line prompt.)
The js module provides support for using JavaScript in doctests using python-spidermonkey. It provides some examples of defining custom doctest parsers.