For 1 click script
Add torus and go to edit mode. Then select a single face (confirm that ur in face selection) and run
import bpy
bpy.ops.mesh.faces_select_linked_flat(sharpness=0.261799)
bpy.ops.mesh.select_nth(nth=3, offset=0)
bpy.ops.transform.translate(value=(0, 0, 0.5), constraint_axis=(False, False, True), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, release_confirm=True)
If you just want to select a face loop
Add a torus and go to edit mode. Then select a single face (confirm that you are in face selection) and run
import bpy
bpy.ops.mesh.faces_select_linked_flat(sharpness=0.261799)
