You confuse packages with classes that I think. Personally, I would put every class definition and all functions that were directly related to this class in the same .py file. For example, reading is not an object, so I would put it as a function of the Book class, and not my own .py file. Thus, the structure will look something like this.
/school/ pencil.py book.py
Inside book.py you will have something like this
class Book(): def __init__(self,name,author,isbn,your_variable_here):
Then your import is as follows.
from school import book b = book.Book("The Art of War","Sun Tzu",'999342052X','Books rock!') b.read(ike)
This advantage of this system is that it models reality more closely. Instead of a set of functions connected by a file structure (which, as you have noticed, can be confusing), you group classes into logical groups and constructs. However, I would say that the Student should have a reading function, and the library should have a verification function, leaving books only with a recording function. But this is because books are not read, people are made. And books are not checked, libraries do. This is a question about how you want to organize it.
source share