def GetSection(sectionName): for seg in idautils.Segments(): if idc.SegName(seg) == sectionName: return seg return 0