05-Python

Python(Part.1)| Pythonの概要とインストール(Windows11)| Overview and Installation of Python (Windows11)

python| まとめ | 現役エンジニア&プログラミングスクール講師「python」のまとめページです。pythonに関して抑えておきたい知識や文法やにについて記事をまとめています。まとめページの下部には「おすすめの学習書籍」「おすすめのITスクール情報」「おすすめ求人サイト」について情報を掲載中...

目標(Objectives)

「Pythonの概要」について理解する。
「Windows11へのPythonのインストール方法」について理解して行える。

To understand “Overview of Python”.
To understand “How to install Python on Windows 11”.

Pythonの概要(Overview of Python)

Pythonの概要(Overview of Python)

Pythonとは(What is Python?)

「python」は1990年代から存在するプログラミング言語です。「python」には次のような特徴があります。

  1. オープンソースで配布されている。(無料で利用できます。)
  2. ソースが公開されている。(プログラム自体を調べることが可能)
  3. ライブラリが豊富で幅広い分野で利用される。
    • 機械学習
    • ディープラーニング
    • データ分析
    • Web開発
  4. Windows、Mac、LinuxOSを問わず利用できる。
  5. 様々なプログラミングパラダイムに対応している。

Python is a programming language that has existed since the 1990s. Python has the following characteristics

  1. It is distributed as open source. (It is available free of charge.)
  2. The source code is publicly available. (The program itself can be examined.)
  3. It has abundant libraries and is used in a wide range of fields.
    • Machine Learning
    • Deep learning
    • Data Analysis
    • Web development
  4. Can be used on any Windows, Mac, or Linux OS.
  5. Supports various programming paradigms.

「プログラミングパラダイム」とはプログラミングの考え方(概念)です。
プログラミングパラダイムには「手続き型プログラミング」「オブジェクト指向プログラミング」「関数型プログラミング」などがあります。

A programming paradigm is a way of thinking about programming. Programming paradigms include “procedural programming,” “object-oriented programming,” and “functional programming.

pythonは現在、「pythonソフトウェア財団」によって開発・サポートされています。

Python is currently developed and supported by the Python Software Foundation.

この記事では実際に、「pythonソフトウェア財団」のサイトページからpythonをインストールしていきます。

In this article, we will actually install python from the “Python Software Foundation” site page.

Pythonのインストール手順(Windows11)
Python Installation Procedure(Windows11)

Pythonのインストール手順(Windows11)
Python installation procedure (Windows11)

Pythonのインストール手順(Windows11)
Python installation procedure (Windows11)

Pythonのインストール状況確認
Check the installation status of Python

「python」が既にインストールされているかを確認します。コマンドプロンプトを立ち上げて「python -V」と入力します。コマンドプロンプトの起動方法が分からない場合は次の記事を参考にしてください。

Check if “python” is already installed. Launch a command prompt and type “python -V”. If you do not know how to start the command prompt, please refer to the following article.

Windows11|コマンドプロンプトの起動方法 | 現役エンジニア&プログラミングスクール講師Windows11|コマンドプロンプトの起動方法について記事にしています。起動方法としてタスクバーの「検索」ボックスから「コマンドプロンプト」を検索する方法と、タスクバーの非表示時に便利なファイル検索ボックスからの起動方法について取り上げています。...

「python」がインストールされていなければ次のように表示されます。
If “python” is not installed, the following will be displayed

「python」がインストールされていると「Pythonのバージョン」が表示されます。
If “python” is installed, “Python Version” will be displayed.

pythonは複数のバージョンをインストールすることが可能です。その場合は利用時にバージョンを指定することができます。

Multiple versions of python can be installed. In that case, you can specify the version at the time of use.

Windowsアーキテクチャの確認
Check Windows architecture

環境にあったpythonのインストールを行うためにWindowsのアーキテクチャの確認を行います。PCのアーキテクチャが64bitであれば64bitのpythonをダウンロードし、32bitであれば32bitのpythonをダウンロードします。

To install the appropriate python for your environment, check the Windows architecture: if your PC architecture is 64-bit, download the 64-bit python; if your PC architecture is 32-bit, download the 32-bit python.

Windows11では64bitのpythonでほぼ間違いありませんが、アーキテクチャの確認方法は知っておいて損はないので、この記事ではこちらの操作も併せて行っています。

In Windows 11, it is almost certainly python for 64-bit, but it is good to know how to check the architecture, so this article also includes this operation.

PCの64bit、32bitに関してはWindowsのスタートメニュー>ユーザーアイコン>アカウント設定の変更>システム>バージョン情報で確認できます。

As for info of 64-bit or 32-bit PCs, you can check by going to the Windows Start Menu > User Icon > Change Account Settings > System > About.

タスクバーにある「スタートメニュー」をクリックします。

Click “Start Menu” on the taskbar.

「アカウント名」をクリックします。この記事では「ほわほわ」です。

Click on “Account Name.” In this article, it is “ほわほわ”.

表示されるメニューから「アカウント設定の変更」をクリックします。

From the menu that appears, click on “Change Account Settings”.

アカウント設定の画面が表示されたら左メニューから「システム」を選択します。

When the Account Settings screen appears, select “System” from the left menu.

システムの設定項目から「バージョン情報」をクリックします。

Click on “About” from the System Settings section.

「デバイスの仕様」から「システムの種類」を確認します。「64ビットオペレーティングシステム、x64ベースプロセッサ」が確認できます。

From “Device Specifications,” check “System Type. You will see “64-bit operating system, x64-based processor.

Pythonのダウンロード
Download Python

「Pythonのインストール」を行うにはまず「pythonのダウンロード」を行う必要があります。pythonのダウンロードはpythonソフトウェア財団のページから行います。pythonソフトウェア財団のページはこちら(https://www.python.org/)になります。

To install Python, you must download Python from the Python Software Foundation page, which can be found at (https://www.python. org/).

URLへアクセスすると下のキャプチャのように表示されます。 

When you access the URL, it will appear as shown in the capture below.


「Download」をマウスホバーすると「Windows」とかかれたプルダウンメニューが表示されます。「Windows」をクリックします。

Move the mouse cursor over “Download” and a pull-down menu labeled “Windows” will appear.

【English translation of captcha】
①Downloadsにマウスカーソルを乗せます。
→①Hover the mouse cursor over the Downloads.
②Windowsをクリックします。
→②Click on Windows.

「Windows」をクリックするとpythonのダウンロードファイルのリストが表示されます。インストールには安定板(Stable Releases)の列から「Windows installer(64bit)」を選択して行います。(この記事では「python3.11.3のWindows installer(64bit)」をダウンロードしています。

Click on “Windows” and a list of “python download files” will appear. To install, select “Windows installer(64bit)” from the Stable Releases column. (This article downloads the ” python3.11.3 Windows installer (64bit )”.

バージョン番号は3つのセグメントに分かれています。

左:メジャーバージョン
中央:マイナーバージョン
右:ビルドバージョン(パッチバージョン)

この内、左と中央が同じものは右(ビルドバージョン)が違っても同じバージョンのものとして扱えます。中央(マイナーバージョン)が違うと同じ3系でも違うpythonとなります。

Version numbers are divided into three segments.

Left: Major version
Center: Minor version
Right: Build version (patch version)

If the left and center numbers are the same, they can be treated as the same version even if the right (build version) is different. If the center (minor version) is different, it will be a different python even if they are the same 3 series.

※この記事では「3.11.3」をインストールしましたが、バージョンについては希望のものを選択してください。

※In this article, we installed “3.11.3”, but you may select any version you wish.

【English translation of captcha】
Pythonのバージョンが「3.11.3」で64bit版のpythonをインストールします。
→Install the 64-bit version of python with Python version “3.11.3”.

リンクをクリックするとダウンロードが行われます。

Click on the link to download the file.

【English translation of captcha】
pythonがダウンロードされます。
→python will be downloaded.

ダウンロードされたファイルを開きます。

Open the downloaded file.

「このアプリがデバイスに変更を加えることを許可しますか?」と聞かれます。「はい」をクリックすると下のキャプチャのようなインストール準備のポップアップが表示されます。

You will be asked, “Do you want to allow this app to make changes to your device? Click “Yes” and you will see a pop-up window ready to install, as shown in the capture below.

「Add python.exe to PATH」にチェックを入れます。ここにチェックを入れるとpythonがインストールされるディレクトリが環境変数のPATHに登録されます。これによってインストールされたディレクトリ以外でもpythonの利用が可能になります。基本的にはチェックを入れると考えて問題ありません。

Check the “Add python.exe to PATH” checkbox. If you check this box, the directory where python will be installed will be registered in the PATH environment variable. This makes it possible to use python in directories other than the one in which it is installed. Basically, it is safe to assume that the check box is checked.

【English translation of captcha】
「Add python.exe PATH」にチェックを入れます。
→Check the “Add python.exe PATH” checkbox.

「Add python.exe to PATH」にチェックを入れたら「Install Now」をクリックします。

After checking the “Add python.exe PATH” checkbox, click “Install Now”.

【English translation of captcha】
「Add python.exe PATH」にチェックを入れたら「Install Now」をクリックします。
→After checking the “Add python.exe PATH” checkbox, click “Install Now”.

インストールが終了すると次の表示になります。「Close」をクリックします。

When the installation is complete, the following display appears. Click “Close”.

【English translation of captcha】
「Close」をクリックします。
→Click “Close.”

インストールの状況を確認します。コマンドプロンプトを再度開き直して「python -V」と入力します。バ―ションが表示されていれば成功です。

Check the status of the installation. Reopen the command prompt and type “python -V”. If the version is displayed, it was successful.

実行できるか確認してみたいと思います。コマンドプロンプトで「python」と入力します。プロンプトの表示が「>>>」と変わります。

I would like to see if I can run it. At the command prompt, type “python”. The prompt will change to “>>>”.

「>>>」と表示され「python」を実行できるモードに切り替わりました。
これは「python」を実行できるシェルで「インタラクティブシェル」「python console」と呼びます。この「インタラクティブシェル」は一行のpythonプログラムを入力するごとに、次の入力を求められるため、対話式の実行モード「インタラクティブモード」と呼ばれます。

The shell is now displayed as “>>>” and switches to a mode in which “python” can be executed.

This is a shell that can execute “python” and is called an “interactive shell” or”python console”.

This “interactive shell” is called “interactive mode” as well because each time you enter a line of a python program, you are asked to enter the next line.

「1+1」と入力してみます。pythonが動いて「2」と返って次の入力が求められます(新しく「>>>」と表示される)。python consoleから抜ける場合は「exit()」と入力します。

Enter “1+1” as follows and Press Enter key. Python will run and return “2”. Then python console asks for the next input (a new “>>>” is displayed). to exit from python console, type “exit()”.

pythonのインストールとインストールの確認はこれで終了です。

This completes the installation of python and confirmation of the installation.

今回は以上になります。

That’s all for this time.

「python」おすすめ書籍 ベスト3 | 現役エンジニア&プログラミングスクール講師「python」の学習でお勧めしたい書籍をご紹介しています。お勧めする理由としては、考え方、イメージなどを適切に捉えていること、「生のpython」に焦点をあてて解説をしている書籍であることなどが理由です。勿論、この他にも良い書籍はありますが、特に質の高かったものを選んで記事にしています。ページの下部には「おすすめのITスクール情報」「おすすめ求人サイト」について情報を掲載中。...

ブックマークのすすめ

「ほわほわぶろぐ」を常に検索するのが面倒だという方はブックマークをお勧めします。ブックマークの設定は別記事にて掲載しています。

「お気に入り」の登録・削除方法【Google Chrome / Microsoft Edge】| 現役エンジニア&プログラミングスクール講師「お気に入り」の登録・削除方法【Google Chrome / Microsoft Edge】について解説している記事です。削除方法も掲載しています。...
【パソコン選び】失敗しないための重要ポイント | 現役エンジニア&プログラミングスクール講師【パソコン選び】失敗しないための重要ポイントについての記事です。パソコンのタイプと購入時に検討すべき点・家電量販店で見かけるCPUの見方・購入者が必要とするメモリ容量・HDDとSSDについて・ディスプレイの種類・バッテリーの持ち時間や保証・Officeソフト・ウィルス対策ソフトについて書いています。...
RELATED POST
05-Python

Python(Part.19)| pythonのリスト(利用編-4)【リストのメソッド(2/2)】| 現役エンジニア&プログラミングスクール講師

2023年12月7日
プログラミング学習 おすすめ書籍情報発信 パソコン初心者 エンジニア希望者 新人エンジニア IT業界への就職・転職希望者 サポートサイト Programming learning Recommended schools Recommended books Information dissemination Computer beginners Prospective engineers New engineers Prospective job seekers in the IT industry Support site
05-Python

Python(Part.9)| pythonの基礎【制御構造】| 現役エンジニア&プログラミングスクール講師

2023年9月26日
プログラミング学習 おすすめ書籍情報発信 パソコン初心者 エンジニア希望者 新人エンジニア IT業界への就職・転職希望者 サポートサイト Programming learning Recommended schools Recommended books Information dissemination Computer beginners Prospective engineers New engineers Prospective job seekers in the IT industry Support site
05-Python

Python(Part.7)| pythonの基礎【組み込み関数(1)】| 現役エンジニア&プログラミングスクール講師

2023年9月16日
プログラミング学習 おすすめ書籍情報発信 パソコン初心者 エンジニア希望者 新人エンジニア IT業界への就職・転職希望者 サポートサイト Programming learning Recommended schools Recommended books Information dissemination Computer beginners Prospective engineers New engineers Prospective job seekers in the IT industry Support site
05-Python

「python」おすすめ書籍 ベスト3 | 現役エンジニア&プログラミングスクール講師

2023年9月20日
プログラミング学習 おすすめ書籍情報発信 パソコン初心者 エンジニア希望者 新人エンジニア IT業界への就職・転職希望者 サポートサイト Programming learning Recommended schools Recommended books Information dissemination Computer beginners Prospective engineers New engineers Prospective job seekers in the IT industry Support site
05-Python

Python(Part.12)| pythonの基礎【論理演算子】| 現役エンジニア&プログラミングスクール講師

2023年11月11日
プログラミング学習 おすすめ書籍情報発信 パソコン初心者 エンジニア希望者 新人エンジニア IT業界への就職・転職希望者 サポートサイト Programming learning Recommended schools Recommended books Information dissemination Computer beginners Prospective engineers New engineers Prospective job seekers in the IT industry Support site
05-Python

Python(Part.26)| pythonの基礎【選択構造】(match文)(1)| The Basics of python [Selection Structure] (match statement)(1)

2024年5月8日
プログラミング学習 おすすめ書籍情報発信 パソコン初心者 エンジニア希望者 新人エンジニア IT業界への就職・転職希望者 サポートサイト Programming learning Recommended schools Recommended books Information dissemination Computer beginners Prospective engineers New engineers Prospective job seekers in the IT industry Support site