I see this is a continuation from this post
I suggest that you don't inherit SampleApp but instead pass an instance of SampleApp to PageOne.
This is an example of what you are trying to do
I suggest that you don't inherit SampleApp but instead pass an instance of SampleApp to PageOne.
This is an example of what you are trying to do
class Frame: def __init__(self): print('Frame') class SampleApp: def __init__(self): print('SampleApp') self.oppna_data_filer() PageOne() def oppna_data_filer(self): self.file1 = 'file1' class PageOne(Frame, SampleApp): def __init__(self): Frame.__init__(self) print('PageOne') print(self.file1) one = SampleApp()which will give
SampleApp Frame PageOne AttributeError: 'PageOne' object has no attribute 'file1'This is an example of how it would look passing PageOne the instance of SimpleApp
class Frame: def __init__(self): print('Frame') class SampleApp: def __init__(self): print('SampleApp') self.oppna_data_filer() PageOne(self) def oppna_data_filer(self): self.file1 = 'file1' class PageOne(Frame): def __init__(self, sample_app): Frame.__init__(self) print('PageOne') self.sample_app = sample_app print(self.sample_app.file1) one = SampleApp()which will give
SampleApp Frame PageOne file1P.S. Class Intermediate: Inheritance