Specify attributes in constructor in Python
I’m confused about the differences of the following codes:
How to make a function accessible from both the object and the class itself?
I have a simple class called Storage
that has many methods and properties.
How to make a function accessible from both the object and the class itself?
I have a simple class called Storage
that has many methods and properties.
How to call attribute from another class before adding a class its own methods
# Example functions def report1(): print(“Function report1 is running.”) # # Create Job instances and associate functions with them job1 = Job().do(report1, ‘report1’).every(5).second.until(‘jkfcedf’) scheduler = Scheduler(threading=False,time_zone=-1) scheduler.add_job(job1) scheduler.run_all() when running scheduler = Scheduler(threading=False,time_zone=-1) this line I want Job() class to be able to read timezone from Scheduler class before add_job adds it, so I can […]
How to call attribute from another class before adding a class its own methods
# Example functions def report1(): print(“Function report1 is running.”) # # Create Job instances and associate functions with them job1 = Job().do(report1, ‘report1’).every(5).second.until(‘jkfcedf’) scheduler = Scheduler(threading=False,time_zone=-1) scheduler.add_job(job1) scheduler.run_all() when running scheduler = Scheduler(threading=False,time_zone=-1) this line I want Job() class to be able to read timezone from Scheduler class before add_job adds it, so I can […]
How to call attribute from another class before adding a class its own methods
# Example functions def report1(): print(“Function report1 is running.”) # # Create Job instances and associate functions with them job1 = Job().do(report1, ‘report1’).every(5).second.until(‘jkfcedf’) scheduler = Scheduler(threading=False,time_zone=-1) scheduler.add_job(job1) scheduler.run_all() when running scheduler = Scheduler(threading=False,time_zone=-1) this line I want Job() class to be able to read timezone from Scheduler class before add_job adds it, so I can […]
i am beginner in python and i am trying to understand OOPs concept but i got error while importing the class
i made a list of questions and use them as dictionary, then created a class and trying to make the object that used to make the question bank and that part is all good. But in next step i am trying to pass the created object (question bank ) to another object to ask the user question and get the answer from him, in this step i am getting error.
This is error
from multi_class import Quession, Askqueans
ImportError: cannot import name ‘Askqueans’ from ‘multi_class.
module has no attribute OOP in python
I’m very new to OOP in python.