Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python:检查CVS存储库中的目录_Python_Repository_Cvs_Directory Structure - Fatal编程技术网

Python:检查CVS存储库中的目录

Python:检查CVS存储库中的目录,python,repository,cvs,directory-structure,Python,Repository,Cvs,Directory Structure,我想知道我是否可以使用 os.path.isdir(sourceDirectory) 检查CVS存储库中是否存在目录。类似地,如果os.walk方法适用于存储库目录。如果没有,什么是解决这个问题的好方法?操作系统已经很好地处理了这个问题!python不是很棒吗? 下面的示例在计算机的根目录中搜索名为CSV的文件,但您可以将其指向您喜欢的任何目录,包括相对路径 def file_exists(): path = '/' # the path you want to search for t

我想知道我是否可以使用

os.path.isdir(sourceDirectory)

检查CVS存储库中是否存在目录。类似地,如果os.walk方法适用于存储库目录。如果没有,什么是解决这个问题的好方法?

操作系统已经很好地处理了这个问题!python不是很棒吗? 下面的示例在计算机的根目录中搜索名为CSV的文件,但您可以将其指向您喜欢的任何目录,包括相对路径

def file_exists():
   path = '/' # the path you want to search for the file in
   target = 'CSV' # name of the directory
   if target in os.list:
      #do whatever you were going to do once you confirmed that this file exists
      return True
   return False

谢谢,这不是我想要的,但我认为我的问题的基础没有真正意义。如果我在CVS(并发版本系统)存储库中快速临时签出目录,我会在本地得到一个工作副本,显然操作系统模块将按预期工作。然后我可以删除临时目录。