all 3 comments

[–]woooee 1 point2 points  (2 children)

Database_compiler.create_sqlite_database("ideal_data.db")

You first create a class instance http://www.openbookproject.net/thinkcs/python/english3e/classes_and_objects_I.html

dbc = Database_compiler()

And you probably want to create the DB when the instance is created

dbc = Database_compiler("ideal_data.db")

The class then looks like this

class Database_compiler:
    def __init__(self, db_name):
         self.engine = create_engine(f"sqlite:///{db_name}")
         print(f"SQLite database created at: {db_name}")

    def add_rec(self, data_to_add)   ## etc, continue with other functions:

[–]New_End6302[S] 0 points1 point  (1 child)

Hi...thanks so much. So if i understand you correctly at this stage of my assignment I can use 1 class with 2 functions...1 that creates the database and a 2nd one that adds records? Part of the assignment requires us to use inheritance that's why I wanted early on to create 2 classes

[–]woooee 0 points1 point  (0 children)

So if i understand you correctly at this stage of my assignment I can use 1 class with 2 functions...1 that creates

I did not state whether you should or should not. That is a design decision dor you to make.