Skip to content

Instantly share code, notes, and snippets.

@sfaleron sfaleron/
Last active Nov 7, 2018

What would you like to do?
Scrapes the commands from a Mathomatic session
# Scrape a Mathomatic session for the commands. Does not catch special
# prompts, such as "Enter <identifier>: " after a calc command.
# Mathomatic: lightweight command-line Computer Algebra System
from __future__ import print_function
import sys
import re
r = re.compile(r'^\d+-> (.*)$')
for ln in sys.stdin:
m = r.match(ln)
if m:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.