Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#!/usr/bin/env python3
# coding: utf-8
Author : weaming
Created Time : 2019-04-24 12:41:48
import subprocess
import sys
import os
def run_shell(command):
return[os.getenv("SHELL") or "bash", "-c", command]).returncode
def read_lines():
rv = []
for x in sys.stdin:
x = x.rstrip("\n")
x = x.lstrip("$ ")
if x == "DONE":
return rv
commands = "; ".join(read_lines())

This comment has been minimized.

Copy link
Owner Author

weaming commented Apr 24, 2019

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.