I've finished one python beginner's book. In the second week, I will write down what I forgot.
** Command line arguments ** You can pass values to the program when you run the program from the shell. This value is called a command line argument.
Command line arguments
>>>python effective file name command line argument 1 command line argument 2 ...
argv : Effective file name argv : Command line argument 1 argv : command line argument 2
** Error handling ** try, except: If there is an error in the try part, except processing is performed.
** join method ** Insert a string between all elements.
** map function ** Returns a list of the results of applying the function to all the elements of the list as arguments.
>>> map(str,[1,2,3]) ["1","2","3"]
** How to raise an error ** Use raise.
raise Exception("It is an error")
** super (data_kata, self) function **
A function that takes two arguments, the name of the data type and self, and returns its parent class.
When inheritance is used when creating a class, if you write a method with the same name as the one in the parent class in the child class, the method of the parent class will be overwritten.
Be especially careful when adding initialization methods!
super (oya, self) and then add the code.
** Important here! ** ** -Variables used in the function should be those defined inside the function or those received as arguments.