cssmagic / Learn-AI-Assisted-Python-Programming

📖 《AI 辅助编程 Python 实战》这本书的大本营。
142 stars 15 forks source link

[译] [900] 第九章 繁琐事务自动化 #15

Open cssmagic opened 9 months ago

cssmagic commented 9 months ago

9 Automating Tedious Tasks

第九章 繁琐事务自动化

This chapter covers

本章内容概要

Suppose that you’re responsible for creating 100 reports, one for each of 100 people. Perhaps you’re a teacher and need to send a report to each of your students. Perhaps you work for HR and need to send an annual assessment report to each employee. Regardless of your role, you have the problem of having to create these reports, and you decided to prepare your reports as .pdf files. You need a customized cover page for each report, too, and those cover pages are designed by one of your colleagues (a graphic design artist).

假设你需要制作 100 份报告,每个人分得一份。可能你是教师,需要向每位学生发送一份报告;或者你在人力资源部门,需要向每位员工发送年度评估报告。不论你担任何种角色,你都将面临制作这些报告的挑战,并且你决定以 .pdf 格式来准备这些报告。每份报告还需一个个性化的封面,这些封面由你的一位同事——一位平面设计艺术家——设计。

You and your colleague work independently, and finally, the job is done. Or wait, not so fast. Because now you have to put each cover page at the beginning of each of your reports.

你和你的同事分头工作,终于,任务完成了。但是,别急。因为现在你必须把每个封面页添加到每份报告的最前面。

At this point, a non-programmer might grit their teeth and start on the job, manually merging the cover page with the first report, the second cover page with the second report, and so on. That could take hours. Not knowing that there may be another way, a non-programmer may just power ahead until the job is done.

此刻,非程序员可能只能硬着头皮开始工作,手动将每个封面与相应的报告一一合并,从第一个封面和报告开始,如此下去。这样的工作可能需要耗费数小时。由于不知道还有其他解决办法,非程序员可能只会坚持到底,直至任务完成。

But you’re a programmer now. And most programmers, the two of us included, would never power ahead with manual work like this.

然而,你现在是一名程序员。包括我们自己在内的绝大多数程序员,都不会选择坚持这种手动重复的工作。

...

...


本章目录


本章正文略。如需阅读,请购买正版。


cssmagic commented 3 months ago

👉 想要更多译稿预览,请前往 总目录 中按章节阅读。