mypeda.py 文件源码

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

项目:mgtools 作者: miyagaw61 项目源码 文件源码
def save_snapshot(self, filename=None):
        """
        Save a snapshot of current process to file
        Warning: this is not thread safe, do not use with multithread program

        Args:
            - filename: target file to save snapshot

        Returns:
            - Bool
        """
        if not filename:
            filename = self.get_config_filename("snapshot")

        snapshot = self.take_snapshot()
        if not snapshot:
            return False
        # dump to file
        fd = open(filename, "wb")
        pickle.dump(snapshot, fd, pickle.HIGHEST_PROTOCOL)
        fd.close()

        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号