Maya PYTHON _ if statement


#1

Hi I want to make a window that when I click the button, only the curves are selected and their names are printed inside the textField. I only know how to select everything and print them all in the textField . Please help. thanks

window = cmds.window( widthHeight=(490, 485),title="braid")

def ygk_CurveSelect(*args):         
sels = cmds.ls(selection=True)
for sel in sels:
    if sel == cmds.ls(type='nurbsCurve', noIntermediate=True, objectsOnly=True, recursive=True):
        selString = " ".join(sel)
        add = cmds.textField('ygk_PathText', edit=True, text=selString)
        print 'fuck yeah!'
    else: 
        print 'fuck no!'     
 
cmds.columnLayout(adjustableColumn=True)
cmds.rowLayout( numberOfColumns=3, columnAttach=(1, 'right', 10), columnWidth=[(1,143),(2,245),(3,20)] )
cmds.text(label='Surface')
ygk_textFld = cmds.textField('ygk_PathText', width=240)
cmds.button(label='Assign Curves', command=ygk_CurveSelect)

cmds.showWindow()