job.py 文件源码

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

项目:PyPPL 作者: pwwang 项目源码 文件源码
def rc (self, val = None):
        """
        Get/Set the return code
        @params:
            `val`: The return code to be set. If it is None, return the return code. Default: `None`
            If val == -1000: the return code will be negative of current one. 0 will be '-0'
        @returns:
            The return code if `val` is `None`
            If rcfile does not exist or is empty, return 9999, otherwise return -rc
            A negative rc (including -0) means output files not generated
        """
        if val is None:
            if not path.exists (self.rcfile):
                return -1

            with open (self.rcfile) as f:
                return int(f.read().strip())
        else:
            with open (self.rcfile, 'w') as f:
                f.write (str(val))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号