Skip to Content
DevOpsのためのPython
book

DevOpsのためのPython

by Noah Gift, Kennedy Behrman, Alfredo Deza, Grig Gheorghiu
March 2025
Intermediate to advanced
506 pages
8h 3m
Japanese
O'Reilly Media, Inc.
Content preview from DevOpsのためのPython

第1章. DevOpsのためのPythonエッセンシャルズ

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

DevOpsは、ソフトウェア開発と情報技術の演算子を組み合わせたもので、過去10年間ホットな分野であった。ソフトウェア開発、デプロイ、メンテナンス、品質保証の間の伝統的な境界が壊され、より統合されたチームが可能になった。Pythonは、柔軟性、パワー、使いやすさを兼ね備えているため、従来のIT演算子でもDevOpsでも人気の言語となっている。

プログラミング言語Pythonは、1990年代初頭にシステム管理用に公開された。この分野で大きな成功を収め、広く採用されるようになった。Pythonはあらゆる分野で使われる一般化プログラミング言語だ。Pythonは、視覚効果や映画業界で採用された。最近では、データサイエンスとマシンラーニング(ML)のデファクト言語となり、航空業界からバイオインフォマティクスまで、幅広い業界で使われている。Pythonには、ユーザの幅広いニーズをカバーするツールが豊富に揃っている。Python標準ライブラリ(Pythonのインストール時に付属する機能)をすべて学ぶのは大変な作業だ。Pythonのエコシステムを盛り上げるサードパーティーのパッケージをすべて学ぼうとすれば、膨大な作業になる。朗報は、そういったことをする必要がないということだ。Pythonのほんの一部を学ぶだけで、強力なDevOps実践者になれるのだ。

この章では、数十年にわたるPython DevOpsの経験を活かして、必要な言語の要素だけを教える。 これらは、Python DevOpsで日常的に使われる部分だ。これらは、物事を成し遂げるために不可欠なツールボックスを形成する。これらの核となる概念を押さえれば、後の章で説明するように、より複雑なツールを追加することができる。

Pythonのインストールと実行

この概要のコードを試すには、Python 3.7以降がインストールされていて(この記事を書いている時点の最新リリースは3.8.0)、シェルにアクセスできる必要がある。macOS X、Windows、そしてほとんどのLinuxディストリビューションでは、ターミナル・アプリケーションを開いてシェルにアクセスできる。 使用しているPythonのバージョンを確認するには、シェルを開き、python と入力する。 --version:

$ python --version
Python 3.8.0

PythonのインストーラーはPython.orgのWebサイトから直接ダウンロードできる。あるいは、Apt, RPM, MacPorts, Homebrew, Chocolateyなどのパッケージマネージャを使うこともできる。

Pythonシェル

Pythonを実行する最も簡単な方法は、組み込みの対話型インタプリタを使うことだ。シェルでpython とタイプするだけだ。すると対話的にPython文を実行できる。シェルを終了するにはexit() とタイプする。

$ python Python 3.8.0 (default, Sep 23 2018, 09:47:03) [Clang 9.0.0 (clang-900.0.38)] on darwin Type "help", "copyright", "credits" or "license" for more information. ...
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

FastAPIで生成型AIサービスを作る

FastAPIで生成型AIサービスを作る

Alireza Parandeh

Publisher Resources

ISBN: 9798341625402