我写的代码如下:
1234567 | 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,程序运行成功
新闻热点
疑难解答