solium-gutter.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:sublime-solium-gutter 作者: sey 项目源码 文件源码
def get_output(cmd):
    if int(sublime.version()) < 3000:
      if sublime.platform() != "windows":
        # Handle Linux and OS X in Python 2.
        run = '"' + '" "'.join(cmd) + '"'
        return commands.getoutput(run)
      else:
        # Handle Windows in Python 2.
        # Prevent console window from showing.
        startupinfo = subprocess.STARTUPINFO()
        startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
        return subprocess.Popen(cmd, \
          stdout=subprocess.PIPE, \
          startupinfo=startupinfo).communicate()[0]
    else:
      # Handle all OS in Python 3.
      run = '"' + '" "'.join(cmd) + '"'
      try:
        return subprocess.check_output(run, stderr=subprocess.STDOUT, shell=True, env=os.environ)
      except Exception as exception:
        print(exception.output)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号