In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "how to use Python to create a rework certificate in batches". In daily operation, I believe many people have doubts about how to use Python to create rework certificates in batches. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "how to use Python to create rework certificates in batches". Next, please follow the editor to study!
/ 1 Preface /
Affected by the epidemic, enterprises need to issue a certificate for employees to return to work in February and March 2020. Due to the large number of people in our company and the huge workload of copying and pasting, I hereby write this gadget for administrative colleagues and now share it with you.
/ 2 Target /
1. Import Excel name and ID number information into Word template in batch, and generate independent Word documents.
two。 The core idea of this method is the mail merge function of word, which can be understood as the mail merge Python version.
3. It can also realize the functions of batch on-the-job certificate generation, batch wage bar generation, batch certificate generation and so on.
/ 3 libraries involved /
Mailmerge,pandas
/ 4 specific implementation /
1. Make Word template
First of all, the finished product map, as shown above, only the red box for special characters, the rest are ordinary template text, the following details for you how to generate special characters.
Add the function name to the correct location as above to generate the Word template.
two。 Make Excel template
Extract data from the employee information table (you can first filter according to demand, such as employees from other provinces) to ensure that the template contains at least two columns: name and ID number.
The two files are named after "template" respectively.
3. Code implementation
The code is very simple, reading Excel data through pandas, and the following mailmerge usage can be understood as a fixed format.
4. Result display
Print in batch after all is selected!
5. Generate exe file (pyinstaller-F rework certificate batch .py)
The simple version does not need to import Excel data, but fills in the data directly through input () to generate a file.
All right, package and send it to the administration (human resources), and the work is done!
/ 5 Summary /
1. All batch, repetitive and unskilled work can be replaced.
There are many 2.Python knowledge points. If you encounter a problem and actively search for it, there will always be a solution if you try it.
At this point, the study on "how to use Python to create a rework certificate in batch" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.