我编写了一个批处理文件来启动多个.py
文件,这些文件创建了一个地理数据库+要素类(带有域)。.py
使用第二个/sub.py
文件和.csv
文件来获取他的输入
我失败了,因为.bat
找不到这个.csv
。我错过了什么
当前的.bat
代码:
@echo on
"c:\Program Files\ArcGIS\Pro\bin\Python\scripts\propy.bat" "C:\Users\<restofthepath>\mainfile.py"
Pause
文件及;地图结构如下:
我在*.bat文件中添加了“call”,虽然脚本中的暂停现在工作正常,但仍然出现以下错误:
Traceback (most recent call last):
File "C:\Users\<restofthepath>\mainfile.py", line 52, in <module> with open(<theCSVfile>) as infile: FileNotFoundError: [Errno 2] No such file or directory: <nameofthecsvfile>.csv'
主脚本中的第52行包含以下行:
with open(<theCSVfile>) as infile:
mw_fields = csv.DictReader(infile, delimiter = ';')
我是否需要将此“csv.Dictreader”也添加到我的.bat文件中?(可能我误解了.batfile的功能)
每个文件夹中都有一个主文件(和子文件)
将控件传递给第二个批处理文件
propy
时,控件将不会返回到原始批处理文件,因为您没有使用call
关键字请尝试:
call
的意思是“当另一个文件完成时,回来继续执行这个文件。”相关问题 更多 >
编程相关推荐