The road to Python learning (2) library functions

Standard library:

An overview of the Python3 standard library |

xlrd library:

https://www.jb51.net/article/205141.htm

https://www.pynote.net/archives/724

1) merged_cells returns a list, each element is an array of the location information of the merged cell, the array contains four elements (start row, end row, start column, end column) the end row and column are added 1

2) When using xlrd, it is best to use xsl files, formatting=true will report an error for xslx files.

Solution

1. Change from xlsx to xls (the suffix cannot be directly modified)

2. Switch to openpyxl

coding tries to read the file, it's really slow to process, and the rules and macros are all lost.

3. Use pywin32

4. Use the old version xlrd-0.6.1
 

abc library:

The abc module in Python

os library, shutil library:

Python standard library learning-os package, shutil package_furuit's blog-CSDN blog_python shutil package

re library:

find:

Detailed explanation of findall() of python regular expression re module - Programmer Sought

compile:

What is the role of the re.compile function in the variable _Python in pythonrecompile? _weixin_39662578's Blog - CSDN Blog

Openpyxl library:

Using the openpyxl library to read and write xlsx files - Fan Ruoruo - Blog Garden

Python uses openpyxl to read excel font color and cell color - Programmer Sought

Read merged cells:

https://www.jb51.net/article/218374.htm

# 文章中的这个代码有问题
for merged_range in sheet.merged_cell_ranges
# 应该改成
for merged_range in sheet.merged.cells.ranges

deque library: 

When using list to add, there was an error that str could not be added, but it was successfully solved by using deque.

Detailed explanation of the deque module in python - Programmer Sought

 sys library:

Detailed explanation of python's sys module

Why use sys.exit() to exit? :

Why use sys.exit() to exit? | Python notes

---------------------------------------------------------------------------------------------------------------------------------

Record the library commands used during the project, and you can directly refer to them in the future

os library:

1.os.path.join() function: connect two or more path name components

Note:

1). If the first letter of each component name does not contain '/', the function will automatically add
2). If a component is an absolute path, all components before it will be discarded.
3). If the last If the component is empty, the generated path ends with a '/' separator
 

2.os.path.exists(), determine whether the path exists

Guess you like

Origin blog.csdn.net/qq_43681154/article/details/124154228