Python チュートリアル¶
Tip
このチュートリアルは Python を初めて学ぶ プログラマー 向けです。プログラミングを初めて学ぶ 初心者 向け ではありません 。
Python は学びやすく強力なプログラミング言語です。効率的な高レベルのデータ構造と、シンプルながら効果的なオブジェクト指向プログラミングの仕組みを備えています。洗練された構文と動的型付けを持つインタープリタ言語でもあります。こうした特徴から、ほとんどのプラットフォームで幅広い分野のスクリプト作成や迅速なアプリケーション開発に理想的な言語です。
The Python interpreter and the extensive standard library are freely available in source or binary form for all major platforms from the Python website, https://www.python.org/, and may be freely distributed. The same site also contains distributions of and pointers to many free third party Python modules, programs and tools, and additional documentation.
C や C++ (または C から呼び出せる他の言語) で実装した新しい関数やデータ型を追加して、Python インタープリタを簡単に拡張できます。Python はカスタマイズ可能なアプリケーションの拡張言語にも適しています。
このチュートリアルでは Python 言語とシステムの基本的な概念や機能を形式ばらずに紹介します。一般的なプログラミングの基礎知識があることを前提としています。実際に試せるように Python インタープリタを用意しておくと役立ちます。ただし、例はそれぞれ単独で理解できるので、オフラインで読むこともできます。
For a description of standard objects and modules, see Python built-ins reference and The Python standard library. Python 言語リファレンス gives a more formal definition of the language. To write extensions in C or C++, read Python インタプリタの拡張と埋め込み and Python/C API リファレンスマニュアル. There are also several books covering Python in depth.
このチュートリアルはすべての機能を網羅するものではなく、よく使われる機能に限ってもすべてを扱うわけではありません。その代わりに Python の特に注目すべき機能を数多く紹介し、言語の持ち味やスタイルをつかめるようにしています。読み終えるころには Python のモジュールやプログラムを読み書きできるようになり、 The Python standard library で説明されているさまざまな Python ライブラリモジュールについてさらに学ぶ準備も整うでしょう。
用語集 にも目を通しておくと良いでしょう。
- 1. やる気を高めよう
- 2. Python インタープリタを使う
- 3. 形式ばらない Python の紹介
- 4. その他の制御フローツール
- 5. データ構造
- 6. モジュール
- 7. 入力と出力
- 8. エラーと例外
- 9. クラス
- 10. Brief tour of the standard library
- 10.1. Operating system interface
- 10.2. File wildcards
- 10.3. Command-line arguments
- 10.4. Error output redirection and program termination
- 10.5. String pattern matching
- 10.6. 数学
- 10.7. Internet access
- 10.8. Dates and times
- 10.9. Data compression
- 10.10. Performance measurement
- 10.11. Quality control
- 10.12. Batteries included
- 11. Brief tour of the standard library --- part II
- 12. 仮想環境とパッケージ
- 13. さあ何を?
- 14. 対話入力編集と履歴置換
- 15. 浮動小数点演算、その問題と制限
- 16. 付録