python code help


#1

Hi friends i was try to learn python in maya and was find a code but i can’t made it work, the error its in the 21 line with srt function, could some people help me with this,i don’t k now what else to d, thank you.

somebody know wo it work the srt function?

import maya.cmds as cmds

class TabExample:

def __init__(self):
    
    self.win = cmds.window(title="Tabble layout", wh=(300,300))
    
    self.tabs = cmds.tabLayout()
    
    firstTab = cmds.columnLayout()
    cmds.tabLayout(self.tabs, edit=True, tabLabel=[firstTab, 'simpleTab'])
    cmds.button(label ="button")
    cmds.setParent("..")
    
    newLayout = cmds.scrollLayout()
    cmds.tabLayout(self.tabs, edit=True, tabLabel=[newLayout, 'ScrollingTab'])
    cmds.columnLayout()
    
    for i in range (10):
        cmds.button(label ="button" + srt(i+1))
        
    cmds.setParent("..")
    cmds.setParent("..")
    
    cmds.showWindow(self.win)

TabExample()


#2

Simple typo…

srt should be str


#3

str convert your value into a string which is necessary for the UI text label.