Python/Visum错误消息
嗨,如果有人能帮我解读这份来自Python的异常报告,我将不胜感激。我所要做的就是打电话给Visum,带上一个流动包。我认为问题可能出在Python安装上,而不是脚本上。
多谢,
斯蒂芬
我有以下代码:
- import VisumPy.helpers
- #from VisumPy.helpers import CreateVisum
- Visum = VisumPy.helpers.CreateVisum(115)
- fileNames = ["Base06_AM_DS"]
- for fileName in fileNames:
- Visum.LoadVersion(r"Y:/07 Forecasting/10 Review of Highway Model/Test/" + fileName)
- #flow bundle execute and save matrix
- fn = 119545498
- tn = 119545499
- # UC1
- dseg = "UC1"
- filename = "Y:/07 Forecasting/10 Review of Highway Model/Test/AA16DS_AM_SLA1_NB_UC1_F.mtx"
- netElem = Visum.CreateNetElements()
- link = Visum.Net.Links.ItemByKey(fn, tn)
- netElem.add(link)
- fb = Visum.Net.DemandSegments.ItemByKey(dseg).FlowBundle
- fb.Execute(netElem)
- fb.Save(filename,"O")
- # Visum.Procedures.Execute()
- Visum.SaveVersion(r"Y:/07 Forecasting/10 Review of Highway Model/Test/" + fileName)
然后,我收到了以下错误消息:
运行脚本中的文件"C:\Python25\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",第309行
DEBUGGER.RUN(代码对象,__Main__.__dict__,Start_Steping=0)
文件"C:\Python25\Lib\site-packages\Pythonwin\pywin\debugger\__init__.py",第60行,在运行中
_GetCurrentDebugger().run(cmd,global als,local als,Start_Steping)
运行中的文件"C:\Python25\Lib\site-packages\Pythonwin\pywin\debugger\debugger.py",第624行
全球、本地人的执行命令
文件"Y:\07 Forecast\10审查公路模型\测试\Oa_Original_SLA.py",第21行,中
NetElem.add(链接)
文件"C:\Python25\lib\site-packages\win32com\client\__init__.py",第454行,位于__getattr__
引发AttributeError,"'%s'对象没有属性'%s'"%(epr(Self),attr)
AttributeError:''对象没有属性'Add'
>>>