def createFileWithFileName(localPathParam,fileName): totalPath=local_url+'\\'+fileName if not os.path.exists(totalPath): print totalPath file=open(totalPath,'w+') file.close() return totalPath
起初时local_url使用的是绝对路径:F:程序名/imgs
但是了程序一直报No such file or dir的错,后来发现只要换为相对路径即可,
imgs,程序运行成功
以上就是分析使用python的open函数时报No Such File or DIr的错误原因的详细内容,更多请关注Gxl网其它相关文章!
查看更多关于分析使用python的open函数时报NoSuchFileorDIr的错误原因的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did85629