class Catalog:
def __init__(self):
self.different_book_count = 0
self.books = []
def accessCurrentCatalog(self):
return self
class Library:
def __init__(self,name, location, age, aadhar_id,emp_id):
super().__init__(name, location, age, aadhar_id)
self.emp_id = emp_id
def __repr__(self):
return self.name + self.location + self.emp_id
def accesCurrentCatalog(self):
catalog = Catalog().accessCurrentCatalog
return catalog
def addBook(self,name,author,publish_date,pages):
catalog = self.accesCurrentCatalog()
catalog.addBook(name,author,publish_date,pages)
我有两个类,即目录类和库类,我已经创建了目录类的对象,并在目录类方法中进行了一些操作,我想将同一个对象与图书馆员类中进行的所有操作一起使用,以执行进一步的操作同时保持这些状态我尝试了上述方法,但没有成功以上两个类都在不同的模块或文件中......请帮我解决这个谢谢...