http://pastebin.com/y0nBAy9W Try this
If you want to pass a argument to another function you can use partial or lambda, But I will stay with partial :) On Thu, Sep 10, 2015 at 5:52 PM, Félix CT <[email protected]> wrote: > Hello this is my first post, I have troubles with this small script, if > anyone could help me, that would be great. > > The script: > > import maya.cmds as cmds > > def myName( self, nombre, apellido, *args ): > print ( nombre + "_" + apellido ) > > def myWin(): > cmds.window() > cmds.columnLayout() > cmds.button( label= 'Press', c= myName( nombre='Pepe', > apellido='Grillo' ) ) > cmds.showWindow() > > myWin() > > This is the error: > > #TypeError: myName() takes at least 3 arguments (2 given) > > > Saludos!! > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/b58aa1c8-013b-48a8-8499-01a1e2ee9be1%40googlegroups.com > . > For more options, visit https://groups.google.com/d/optout. > -- --:: Kurian ::-- -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CANEMyhOLN3UdX8%2BPQxCXi6_WXj%3DvEC8yEQJpQR0-5b8jQ66wyA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
