我收到一个我无法找出原因的缩进错误。
错误是
('unexpected indent', ('C:/Hamid/Failure_index.py',15,1,'\tSDV2=xyList[0]\n')).
我的代码是
from abaqusConstants import *
from odbAccess import *
from visualization import *
#---------------------------------------------------------------------------
out_file= 'C:\Hamid\Stochastic\Python_script_for_Monte_Carlo_simulation\Microtensile/Failure_index.dat'
fid = open(out_file,'w')
for i in range(1,50):
odb_path = 'C:\Hamid\Stochastic\Python_script_for_Monte_Carlo_simulation\Microtensile/Microtens-'+str(i)+'_xs.odb'
session.openOdb(name=odb_path)
odb = session.odbs[odb_path]
session.viewports['Viewport: 1'].setValues(displayedObject=odb)
xyList = session.xyDataListFromField(odb=odb, outputPosition=INTEGRATION_POINT, variable=(('SDV2', INTEGRATION_POINT), ), elementSets=(' ALL ELEMENTS', ))
SDV2 = xyList[0]
fid.write(SDV2+'\n')
odb.close()
fid.close()