materials.alpha not working
This solved my issue:

    mat.transparency_method = 'Z_TRANSPARENCY'        
    # need the following 2 lines for alpha to work       
    mat.use_transparency = True        
    bpy.context.object.show_transparent = True