(cmd, screen=False)
| 84 | |
| 85 | def itchat_manager(): |
| 86 | def run_and_get(cmd, screen=False): |
| 87 | process = subprocess.Popen( |
| 88 | cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True) |
| 89 | output = '' |
| 90 | |
| 91 | for line in process.stdout: |
| 92 | line = line.decode('utf-8') |
| 93 | if screen: |
| 94 | print(line, end='', flush=True) |
| 95 | output += line.strip(' ') |
| 96 | |
| 97 | return output |
| 98 | |
| 99 | @itchat.msg_register(itchat.content.TEXT) |
| 100 | def text_reply(msg): |