the singleton pattern just quick note with regards to the terms attributes and methods attributes are the pieces of data associated with an object as defined in the class blueprint the functions that perform actions on these pieces of data are referred to as methods when we use the self keyword together with methodlike thisself some_method(what is really happening is that the python interpreter calls the method some_method and passes the object itself as variable into the functionwhich is why you have self as parameter in the methods of the objectbut do not explicitly pass it in when making the call another thing to note is that when referencing an attribute in an objectas in self some_attribute what python does is call method called __getattr__ and pass in the object itself together with the attribute name that it is requesting you will see an example of this soon in the __init__ methodyou will see that we set an attribute called file_name this allows us to request the value of the file_name attribute that we set when we first created the class whenever we want to use the _write_log method the rest is close to what we had beforewith the exception that we now also must make provision for the self parameterwhich we discussed as matter of good practicethe result of the __init__ method must be fully initialized object what that means is that the object must be ready for useit should not require some other settings to be tweaked or methods to be executed before it can perform its function if you are wondering about the leading underscore in _write_logit is just convention to tell other programmers that this method should not be used by any outside programit is said to be private nowwe can look at how this new logger class of ours will be used new_script_with_logger py from logger_class import logger logger_object logger("/var/log/class_logger log"logger_object info("this is an info message"