私は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")
なぜ突然機能しないのかを理解しようとしています。助けてくれてありがとう!