Give keyboard focus to a specific control or panel, passed as an argument.
Derived from mel command maya.cmds.setFocus
Example:
import pymel.core as pm
import maya.cmds as cmds
pm.window()
# Result: ui.Window('window1') #
pm.columnLayout()
# Result: ui.ColumnLayout('window1|columnLayout79') #
pm.textField('tf0', changeCommand='pm.setFocus("tf1")' )
# Result: ui.TextField('window1|columnLayout79|tf0') #
pm.textField('tf1', changeCommand='pm.setFocus("tf2")' )
# Result: ui.TextField('window1|columnLayout79|tf1') #
pm.textField('tf2', changeCommand='pm.setFocus("tf0")' )
# Result: ui.TextField('window1|columnLayout79|tf2') #
pm.showWindow()