def main(): db = DBOperator('localhost', 3306, 'root', '123456', 'dict') server = DictServer(db, HOST, PORT) server.server_forever() db.close()