I am working on a python GTK project and was wondering if it is possible to generate random variable names for naming widget objects and returning them so that it could be used in other parts of program like :
#Class AppGUI:
def createButton(self, buttonlabel):
RandombuttonObjectName = gtk.Button(self.buttonlabel)
RandombuttonObjectName.show()
return RandombuttonObjectName
#Main Program
Button1 = AppGUI.createButton("Button 1")
Button2 = AppGUI.createButton("Button 2")
Kindly suggest how to achieve this random object naming and returning from class to main program.