def pipe_through_prog(cmd, path=None, stdin=''):
"""Run the Vale binary with the given command.
"""
startupinfo = None
if sublime.platform() == 'windows':
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
p = subprocess.Popen(cmd, cwd=path, stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stdin=subprocess.PIPE,
startupinfo=startupinfo)
out, err = p.communicate(input=stdin.encode('utf-8'))
return out.decode('utf-8'), err
评论列表
文章目录