def system(command, answer='<STR_LIT>'):
p = subprocess.Popen(command,<EOL>shell=True,<EOL>stdin=subprocess.PIPE,<EOL>stdout=subprocess.PIPE,<EOL>stderr=subprocess.PIPE,<EOL>close_fds=MUST_CLOSE_FDS)<EOL>i, o, e = (p.stdin, p.stdout, p.stderr)<EOL>if answer:<EOL><INDENT>i.write(answer)<EOL><DEDENT>i.close()<EOL>result = o.read() + e.read()<EOL>o.close()<EOL>e.close()<EOL>return result.decode('<STR_LIT:utf8>')<EOL>
commands.getoutput() replacement that also works on windows