找不到现有文件的原因不明的文件

时间:2010-03-31 13:37:38

标签: python maya

以下是此部分代码中发生的错误。虽然路径有效,但是发生RuntimeError很奇怪。发生了什么,我怎样才能让它发挥作用?

        for root,dirs,files in os.walk(self.path):
            for f in files :
                if (f.split('.')[1] == "mb"):
                z = utils.executeInMainThreadWithResult(self.contains,(f.split('.')[0]))
                    if not (isinstance(z,NoneType)):
                        cmds.symbolButton(self.arSubCategory + f.split('.')[0], image=(z[1].replace("\\","/")), width = 35,height = 70, c = "h.imp_file(" + "\"" + root.replace("\\","/")  + "/" + f + "\"" + ")")


def contains(self,imageName):
    print 'imageName : ',imageName,'\n'
    for root, dirs, files in os.walk(self.path+"images"):
        for g in files:
            x = re.search(imageName,g)
            if not (isinstance(x, NoneType)):
                print 'g ',root+"/"+g.replace("\\","/"),'\n'
                return (1,(root+"/"+g))

错误:

# z is (1, 'T:/Reference_Library/Reference_work/Char_models/Workfiles/images\\rboxdisk1\\female\\highpoly/granny01_highpoly.jpg')

Error: File not found: T:/Reference_Library/Reference_work/Char_models/Workfiles/images/rboxdisk1/female/highpoly/granny01_highpoly.jpg
Traceback (most recent call last):
File "<maya console>", line 115, in <module>
File "<maya console>", line 65, in showWindowanimLibrary
RuntimeError: File not found: T:/Reference_Library/Reference_work/Char_models/Workfiles/images/rboxdisk1/female/highpoly/granny01_highpoly.jpg

1 个答案:

答案 0 :(得分:0)

您是否拥有该文件夹中所有文件的写权限?