PythonQ_A
Q: What is the point of the super() function ?
You generally use this if you overwrite something
in the child class but still need access to what
it was initially defined as.
For example if the parent defines an __init__ method
but the subclass needs to define an __init__ method as well,
you would call the parents __init__ from the child’s __init__
and pass it the needed parameters, so you won’t need to
duplicate the code from the parents __init__ method.
Source: https://www.reddit.com/r/learnpython/comments/dcvsfb/whats_the_point_of_using_the_super_function/
Q: How did you learn the concept of classes and how to use them?
A1: I notice I have a lot of functions that would benefit
from being grouped or a lot of internal states that are being stored.
A2: a class allows us to group the data and the methods that operate on it together
A3: Classes give you a way to define reusable state via certain features
and make you think about your software in terms of both behavior and state
A4: a) A class defines the structure that will become an object
b) An object is an instance of a class. You can have multiple instances
c) An attribute is a value stored in an object.
d) __main__
e) __init__ - gets called when a new instance of a class is created
f) self - refers to the object it is being used in
Source: https://www.reddit.com/r/learnpython/comments/cjq77a/how_would_you_explain_classes_to_the_beginner/
Q: What do you use for reference ?
A1.treedoc Python package. Find it here: https://pypi.org/project/treedoc/
A2.Dash https://kapeli.com/dash on Mac. There is a free knock off at https://devdocs.io that is almost as good.
A3. I use a word document to track all the reusable code I can use (1600 pages so far) and Google Sheets to track class references or methods.
Source:https://www.reddit.com/r/Python/comments/cdae7h/what_do_you_use_for_reference/
Q: Python Matplotlib Tutorial – Learn Plotting in 3 hours
Source: https://www.reddit.com/r/Python/comments/c6kxxv/python_matplotlib_tutorial_learn_plotting_in_3/
Q: Python Application Layouts & Project Structures:
A: https://realpython.com/python-application-layouts/
You generally use this if you overwrite something
in the child class but still need access to what
it was initially defined as.
For example if the parent defines an __init__ method
but the subclass needs to define an __init__ method as well,
you would call the parents __init__ from the child’s __init__
and pass it the needed parameters, so you won’t need to
duplicate the code from the parents __init__ method.
Source: https://www.reddit.com/r/learnpython/comments/dcvsfb/whats_the_point_of_using_the_super_function/
Q: How did you learn the concept of classes and how to use them?
A1: I notice I have a lot of functions that would benefit
from being grouped or a lot of internal states that are being stored.
A2: a class allows us to group the data and the methods that operate on it together
A3: Classes give you a way to define reusable state via certain features
and make you think about your software in terms of both behavior and state
A4: a) A class defines the structure that will become an object
b) An object is an instance of a class. You can have multiple instances
c) An attribute is a value stored in an object.
d) __main__
e) __init__ - gets called when a new instance of a class is created
f) self - refers to the object it is being used in
Source: https://www.reddit.com/r/learnpython/comments/cjq77a/how_would_you_explain_classes_to_the_beginner/
Q: What do you use for reference ?
A1.treedoc Python package. Find it here: https://pypi.org/project/treedoc/
A2.Dash https://kapeli.com/dash on Mac. There is a free knock off at https://devdocs.io that is almost as good.
A3. I use a word document to track all the reusable code I can use (1600 pages so far) and Google Sheets to track class references or methods.
Source:https://www.reddit.com/r/Python/comments/cdae7h/what_do_you_use_for_reference/
Q: Python Matplotlib Tutorial – Learn Plotting in 3 hours
Source: https://www.reddit.com/r/Python/comments/c6kxxv/python_matplotlib_tutorial_learn_plotting_in_3/
Q: Python Application Layouts & Project Structures:
A: https://realpython.com/python-application-layouts/