process.py 文件源码

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

项目:sublimeTextConfig 作者: luoye-fe 项目源码 文件源码
def spawn(args, **kwargs):
    """Spawn a subprocess and return it back
    """

    if 'cwd' not in kwargs:
        kwargs['cwd'] = os.path.dirname(os.path.abspath(__file__))
    kwargs['bufsize'] = -1

    if os.name == 'nt':
        startupinfo = subprocess.STARTUPINFO()
        startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
        kwargs['startupinfo'] = startupinfo

    try:
        return subprocess.Popen(args, **kwargs)
    except Exception as error:
        msg = (
            'Your operating system denied the spawn of {0} process: {1}'
        ).format(args[0], error)
        logging.error(msg)
        raise RuntimeError(msg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号