I have different classes Class1 , Class2 , Class3 , etc., all of which contain this exact fragment inside:
def showName(self): openWindow() print self.name
For instance:
class Class1:
What is the best way to have showName defined once in a separate file and import it back into Class1 , Class2 , Class3 , etc.?
source share