Skip to Content
Python数据处理
book

Python数据处理

by Jacqueline Kazil, Katharine Jarmul
July 2017
Intermediate to advanced
398 pages
11h 54m
Chinese
Posts & Telecom Press
Content preview from Python数据处理
302
14
以特定的时间间隔重复失败的任务。
确保你的代码有很多的
try...except
代码块,让它能够处理错误。
在处理到机器、数据库或
API
的连接的代码周围,构建特殊的异常代码块。
定期维护和监控你为自动化使用的机器。
使用测试数据定期测试你的任务和自动化程序,确保它们正常执行。
注意脚本中出现的依赖、竞争条件和
API
规则,根据这些知识编写代码。
使用类似
requests
multiprocessing
的库,让困难的问题变得更简单,并尝试理解使
脚本运行困难的问题所在。
我们会使用这其中的一些技术和想法,研究如何最好地监控和自动化脚本。现在,让我们
讨论一下自动化中使用的工具,使数据处理更加容易和简单,并给出一些在哪里以及如何
使用这些工具的建议。
14.4
 在哪里自动化
根据脚本需求的不同,决定在哪里运行它是重要的第一步。无论脚本在哪里第一次执行,
你都可以将它移到别的地方,但是这可能需要重写一些代码。在一开始,你可能需要它在
本地运行。在
本地
运行脚本或任务就是在你自己的计算机上运行。
远程
执行意味着在另外的机器上运行,可能是其他地方的服务器。一旦脚本运行成功并且
测试良好,你会想要移动它到远程。如果你管理或拥有服务器,或者为一个有服务器的组
织工作,这样迁移脚本到服务器上会相对简单。这允许你在自己的机器(笔记本电脑或台
式计算机)上工作,并且不用担心在什么时间关闭和打开它。在远程运行脚本也意味着对
你的网络服务提供商来说,你不是独立的。
如果无法访问服务器,但是有一台旧的不再使用的计算机或笔记本电脑,在必要的情况 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

数据科学中的实用统计学(第2版)

数据科学中的实用统计学(第2版)

Peter Bruce, Andrew Bruce, Peter Gedeck
Java持续交付

Java持续交付

Daniel Bryant, Abraham Marín-Pérez
解密金融数据

解密金融数据

Justin Pauley

Publisher Resources

ISBN: 9787115459190