My first attempt at defining the x as global outside function failed and the x was not seen. but when creating it inside the function it worked. Just wondering if im doing something wrong with this?
Is there a different way to pass my variables that are called though button?
from pymel.core import * #global x def hi(): global x x = "Hello" print x return x def hiThere(*args): print x , "is", len(x), "long" window = window(t = "Test return") layout = frameLayout() #hiBut = button(l = "Hello", command = Callback(x = hi)) hiBut = button(l = "Hello", command = Callback(hi)) returnBut = button(l = "return",command = Callback(hiThere, x)) showWindow( window )