Parentheses are used to import python data.
When importing the Python module, we can use
Import OS
You can also use
From OS import *
Of course, the second method is not recommended. In this way, too many functions in the OS module will be imported, so we will use
From OS import name, getcwd
However, if you want to import a large number of functions, the recommended code style will exceed 80 characters in a line. What should you do.
We have three methods:
First, add a backslash \ at the end of the row \,
Second, each line only imports a part and writes several more lines from
However, this is not recommended by PEP. PEP recommends that the imported modules be enclosed in parentheses by standard grouping.
From OS import (name, getcwd)
This method can be divided into multiple rows.
This function is supported from python2.4.
This suggestion can be found in PEP328.