Indentation error
Question: I receive an indentation error that I cannot figure out the reason.  
The error is

    
    
    ('unexpected indent', ('C:/Hamid/Failure_index.py',15,1,'\tSDV2=xyList[0]\n')). 
    

My code is

    
    
    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()
    


Answer: You are mixing tabs and spaces in your source code, and Python's algorithm for
expanding tabs to spaces causes `SDV2 = xyList[0]` to be indented 8 spaces,
not 4 like the other lines in the `for` loop.

