7 basedir = os.path.dirname(sys.argv[0])
8 readme = os.path.join(basedir,
"doc/using.md")
10 with open(readme)
as f:
15 it =
iter(inp.splitlines(
True))
19 if line.startswith(
"```cmdoutput"):
22 assert cmd.startswith(
"$ "), cmd
23 real_cmd = cmd[2:].strip()
26 print(
"Running: " + real_cmd)
27 out += subprocess.check_output(real_cmd, shell=
True)
31 while not line.startswith(
"```"):
35 with open(readme,
"w")
as f: