ros.py 文件源码

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

项目:ROS-Code 作者: Richienb 项目源码 文件源码
def dirtool(operation, directory):
    operation = operation.lower()
    import os
    if operation == 'exists':
        return bool(os.path.exists(directory))
    elif operation == 'create':
        if os.path.exists(directory):
            raise RuntimeError('An Error Has Occured: Directory Already Exists (0007)')
        else:
            os.makedirs(directory)
    elif operation == 'delete':
        if os.path.exists(directory):
            os.rmdir(directory)
        else:
            raise RuntimeError('An Error Has Occured: Directory Doesn\'t Exist (0009)')
    else:
        raise RuntimeError('An Error Has Occured: Invalid Operation Entered (0008)')

# Download A File
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号