running a method within another method. python -


I'm calling one method within another. And I get the error for this script

  Error named: The name 'mnDialog' is not defined  

Is there a reason for this? I think it has been done to execute an order which is not at the global level. (I did not have the assumption that Python's global and local variable is declaration.) What is the correct syntax or is it to go around? Thanks for your time.


  Import cm as CMD def mnProgRun (): def mnDialog (* args): cmds.confirmDialog (title = 'confirm', message = 'are you sure Default button = 'yes', cancel bayton = 'no', rejected = = 'no') def mnMakeWin (): cmds.window ('mnWin', title = ['yes', 'no'], default button = 'yes' 'Testman', wh = (260,100) cmds.columnLayout (adjustable column = false, column_lines = 'center') cmds.button (label = "yes, it works", align = 'center', width = 120 , Height = 25, background-type = [0.5,1,0.5], command = 'cm -Sypscript job (event = ["select switch," "MNDLog"]) 'cmds.button (label = "no thanks!", Align =' center ', width = 120, height = 25, background = [1] , 0.50,5], command = 'cmi.dillu ("mnwin")' 'cmds.showWindow (' mnWin ') mnMakeWin () mnProgRun ()  

The problem is that is not mnDialog seen from mnMakeWin , you name and i Giving when you are not in the right scope will be seen later.

It can work to pass the function instead of the name. Mea is not installed, so I can not try.

Otherwise, you have to define MNDILOG in the global realm which seems like a strange restriction


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -