我正在研究 HecDSS 中的信息读写。昨晚我的脚本运行良好,但今天早上打开它时,我开始收到此错误:
ScriptEngine.execute:Error in script Traceback (innermost last):
File "<string>", line 13, in ?
NameError: java
我现在使用的基本代码是:
from hec.script import *
from hec.hecmath import *
from java import *
try:
dssFile = DSS.open("C:/Documents and Settings/SWP/Desktop/MVCA.dss")
outflow = dssFile.read("/MAITLAND VALLEY/BLYTH/PRECIP-INC/01DEC2011/30MIN/OBS/")
newOutflow = outflow.add(10.)
path = DSSPathname(newOutflow.getPath())
fPart = path.fPart() + " Test"
path.setFPart(fPart)
newOutflow.setPathname(path.getPathname())
dssFile.write(newOutflow)
except java.lang.Exception, e :
MessageBox.showError(e.getMessage(), "Error reading data")
我只是想弄清楚为什么它突然不起作用。谢谢你的帮助!