我最近接触了python,已经遇到了“只接受1个参数(给定2个)”的问题。在
我到处都在找它,而且大部分时间都在读《失踪》来增加自我部分。在
尽管我补充说我不能解决它,我是不是错过了女人的重点?在
import maya.cmds as cmds
class ButtonPress:
def __init__(self):
self.value = 0
def buildUI(self):
window = cmds.window(title = 'Press Button', w = 100, h = 50)
columnL = cmds.columnLayout(w = 100, h = 50)
cmds.button(parent = columnL, label = 'Press me', w = 100, h = 50, command = self.__increaseAndPrint)
cmds.showWindow(window)
def __increaseAndPrint(self):
self.value += 1
print self.value
谢谢你的帮助。在
编辑: 我将maya脚本编辑器中的类用于:
ButtonPress().buildUI()
我得到: 错误:\uUu increaseAndPrint()只接受1个参数(给定2个) 当按下UI按钮时。在
对不起。在
相关问题 更多 >
编程相关推荐