Last active
November 7, 2018 15:36
-
-
Save sfaleron/fafab3c2d7bc1d8048ec155434d4f30d to your computer and use it in GitHub Desktop.
Scrapes the commands from a Mathomatic session
This file contains hidden or 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
# 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