Skip to content

Instantly share code, notes, and snippets.

@sfaleron sfaleron/mathoscraper.py
Last active Nov 7, 2018

Embed
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
# http://mathomatic.orgserve.de/math/
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:
print(m.group(1))
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.