title: Passing variables in python from radio buttons
body: <p>I want to set values depends on the selected radio button and to use that values in other function. 
  Whatever i try, i always get the same answer </p>
  
  <h1>NameError: global name 'tX' is not defined #</h1>
  
  <pre><code>import maya.cmds as cmds
  from functools import partial
  
  winID='MSDKID'
  
  def init(*args):
      print tX
      print tY
      print tZ
      print rX
      print rY
      print rZ    
      return 
  
  def prozor():
  
      if cmds.window(winID, exists = True):
              cmds.deleteUI(winID);
      cmds.window()
      cmds.columnLayout( adjustableColumn=True, rowSpacing=10 )
      cmds.button(label = "Init")
      cmds.button(label = "MirrorSDK",command=init)
      cmds.setParent( '..' )
      cmds.setParent( '..' )
  
      cmds.frameLayout( label='Position' )
      cmds.columnLayout()
      collection2 = cmds.radioCollection()
      RButton0 = cmds.radioButton( label='Behavior' )
      RButton1 = cmds.radioButton( label='Orientation' )
      cmds.button(l='Apply', command = partial(script,RButton0,RButton1,))
      cmds.setParent( '..' )
      cmds.setParent( '..' ) 
      print script(RButton0,RButton1)
      cmds.showWindow()
  
  def script(RButton0,RButton1,*_cb_val):
      X = 0
      rb0 = cmds.radioButton(RButton0, q = True, sl = True)
      rb1 = cmds.radioButton(RButton1,q = True, sl = True)
      if (rb0 == True):
          tX = -1
          tY = -1
          tZ = -1
  
          rX = 1
          rY = 1
          rZ = 1
  
      if (rb1 == True):
          tX = -1
          tY = 1
          tZ = 1 
          rX = 1
          rY = -1
          rZ = -1
          return tX,tY,tZ,rX,rY,rZ        
  
  prozor()  
  </code></pre>