process.py 文件源码

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

项目:OpenXMolar 作者: debasishm89 项目源码 文件源码
def get_explorer_pid(self):
        """
        Tries to find the process ID for "explorer.exe".

        @rtype:  int or None
        @return: Returns the process ID, or C{None} on error.
        """
        try:
            exp = win32.SHGetFolderPath(win32.CSIDL_WINDOWS)
        except Exception:
            exp = None
        if not exp:
            exp = getenv('SystemRoot')
        if exp:
            exp = ntpath.join(exp, 'explorer.exe')
            exp_list = self.find_processes_by_filename(exp)
            if exp_list:
                return exp_list[0][0].get_pid()
        return None

#------------------------------------------------------------------------------

    # XXX this methods musn't end up calling __initialize_snapshot by accident!
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号