Python Forum
Bringing two files together
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bringing two files together
#6
Lars60+ - I'm sorry I missed your post.

import a
  
  
class B:
    def __init__(self):
        self.a = a.A()
  
    def bar(self):
        print('B.bar')
 
    def bspam(self):
        self.a.spam()
 
if __name__ == '__main__':
    b = B()
    b.bspam()
This is so much more than what is in the book. It was written by David Beazley so I know it's old because he is writing a newer edition. Can you point me in the direction of where you learned this so I can learn how and why you did it this way?

As always - I appreciate your help!
Reply


Messages In This Thread
Bringing two files together - by tjnichols - Oct-12-2018, 11:49 AM
RE: Bringing two files together - by ThiefOfTime - Oct-12-2018, 12:05 PM
RE: Bringing two files together - by tjnichols - Oct-12-2018, 02:21 PM
RE: Bringing two files together - by nilamo - Oct-12-2018, 03:27 PM
RE: Bringing two files together - by Larz60+ - Oct-12-2018, 03:24 PM
RE: Bringing two files together - by tjnichols - Oct-12-2018, 03:55 PM
RE: Bringing two files together - by tjnichols - Oct-12-2018, 04:57 PM
RE: Bringing two files together - by nilamo - Oct-12-2018, 05:29 PM
RE: Bringing two files together - by Larz60+ - Oct-12-2018, 08:42 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020