<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Python on qwerty.work</title>
        <link>https://qwerty.work/tags/python/</link>
        <description>Recent content in Python on qwerty.work</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>ja-JP</language>
        <lastBuildDate>Wed, 11 Jan 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://qwerty.work/tags/python/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>【PyAutoGUI】PythonでWindowsのマウスとキーボードを操作する</title>
            <link>https://qwerty.work/post/2023/01/pyautoguipython%E3%81%A7windows%E3%81%AE%E3%83%9E%E3%82%A6%E3%82%B9%E3%81%A8%E3%82%AD%E3%83%BC%E3%83%9C%E3%83%BC%E3%83%89%E3%82%92%E6%93%8D%E4%BD%9C%E3%81%99%E3%82%8B/</link>
            <pubDate>Wed, 11 Jan 2023 00:00:00 +0000</pubDate>
            <guid>https://qwerty.work/post/2023/01/pyautoguipython%E3%81%A7windows%E3%81%AE%E3%83%9E%E3%82%A6%E3%82%B9%E3%81%A8%E3%82%AD%E3%83%BC%E3%83%9C%E3%83%BC%E3%83%89%E3%82%92%E6%93%8D%E4%BD%9C%E3%81%99%E3%82%8B/</guid>
            <description>&lt;h2 id=&#34;特定のキーを繰り返して押す作業を自動化したい&#34;&gt;特定のキーを繰り返して押す作業を自動化したい&#xA;&lt;/h2&gt;&lt;p&gt;Kintone（キントーン）のレコードの情報を更新するために、編集、保存、次への作業を最初のレコードから最後のレコードまで繰り返し行うことがありました。これをショートカットキーで行っていたのですが、レコード数が少なければ手動で問題ありませんが、これが数百とか数千以上あるとちょっと大変です。&lt;/p&gt;&#xA;&lt;p&gt;ちなみに、レコード詳細画面で**「E」は編集モード**、&lt;strong&gt;「Ctrl+S」が保存&lt;/strong&gt;、&lt;strong&gt;「J」が次のレコードに移動&lt;/strong&gt;を行うショートカットキーで、これを繰り返し連打していました。&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://jp.cybozu.help/k/ja/trouble%5c_shooting/general/shortcuts.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://jp.cybozu.help/k/ja/trouble%5c_shooting/general/shortcuts.html&#34; alt=&#34;https://jp.cybozu.help/k/ja/trouble\_shooting/general/shortcuts.html&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://jp.cybozu.help/k/ja/trouble\_shooting/general/shortcuts.html&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://jp.cybozu.help/k/ja/trouble\_shooting/general/shortcuts.html&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;p&gt;キントーン側でJavascriptを使うやり方もあるかと思うのですが、初心者で無料体験中なので、どうやればいいかわからなかったので、VBScriptとか使ってWindows側からできないかな？と調べていたらPythonとPyAutoGUIというモジュールを使ってできるといったページを見つけたので、試すことにしました。&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://tech-blog.rakus.co.jp/entry/20220613/python#PyAutoGUI%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://tech-blog.rakus.co.jp/entry/20220613/python#PyAutoGUI%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB&#34; alt=&#34;https://tech-blog.rakus.co.jp/entry/20220613/python#PyAutoGUI%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://tech-blog.rakus.co.jp/entry/20220613/python#PyAutoGUI%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://tech-blog.rakus.co.jp/entry/20220613/python#PyAutoGUI%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;h2 id=&#34;pyautoguiをインストール&#34;&gt;PyAutoGUIをインストール&#xA;&lt;/h2&gt;&lt;p&gt;WindowsにPythonがインストールされていることが前提ですが、その状態でコマンドプロンプトを起動し、PyAutoGUIをコマンドでインストールします。&lt;/p&gt;&#xA;&lt;p&gt;Pythonのバージョン確認するコマンド&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;python -v&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;PyAutoGUIをインストールするコマンド。&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;pip install pyautogui&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;pipはPythonのパッケージ管理ツールで、コマンドを実行すると、以下の画面が表示されます。&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;PyAutoGUIインストール画面&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;308px&#34; data-flex-grow=&#34;128&#34; height=&#34;478&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2023/01/pyautoguipython%E3%81%A7windows%E3%81%AE%E3%83%9E%E3%82%A6%E3%82%B9%E3%81%A8%E3%82%AD%E3%83%BC%E3%83%9C%E3%83%BC%E3%83%89%E3%82%92%E6%93%8D%E4%BD%9C%E3%81%99%E3%82%8B/images/No-01.jpg&#34; width=&#34;614&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;インストール完了時の表示。&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;PyAutoGUIインストール完了&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;308px&#34; data-flex-grow=&#34;128&#34; height=&#34;478&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2023/01/pyautoguipython%E3%81%A7windows%E3%81%AE%E3%83%9E%E3%82%A6%E3%82%B9%E3%81%A8%E3%82%AD%E3%83%BC%E3%83%9C%E3%83%BC%E3%83%89%E3%82%92%E6%93%8D%E4%BD%9C%E3%81%99%E3%82%8B/images/No-02.jpg&#34; width=&#34;614&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;インストールされているPythonのパッケージとバージョンを確認するコマンド&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;pip list&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;img alt=&#34;インストールされたパッケージの確認&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;308px&#34; data-flex-grow=&#34;128&#34; height=&#34;478&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2023/01/pyautoguipython%E3%81%A7windows%E3%81%AE%E3%83%9E%E3%82%A6%E3%82%B9%E3%81%A8%E3%82%AD%E3%83%BC%E3%83%9C%E3%83%BC%E3%83%89%E3%82%92%E6%93%8D%E4%BD%9C%E3%81%99%E3%82%8B/images/No-03.jpg&#34; width=&#34;614&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;ここに&lt;strong&gt;PyAutoGUI&lt;/strong&gt;があればOKです。&lt;/p&gt;&#xA;&lt;h2 id=&#34;keyboardモジュールも必要&#34;&gt;Keyboardモジュールも必要&#xA;&lt;/h2&gt;&lt;p&gt;自動化処理を実行中に中断したい場合に備え、特定のキー押下で停止できるようにする場合、キーの押下を検出するために&lt;strong&gt;keyboardモジュール&lt;/strong&gt;が必要です。PyAutoGUI同様にコマンドプロンプトからコマンドでインストールします。&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;pip install keyboard&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;python実行ファイルを用意&#34;&gt;Python実行ファイルを用意&#xA;&lt;/h2&gt;&lt;p&gt;以下のソースをテキストエディタで拡張子を&lt;code&gt;.py&lt;/code&gt;にして適当な場所に保存します。&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;import pyautogui&#xA;import keyboard&#xA;import os&#xA;&#xA;# 一時停止&#xA;os.system(&amp;#39;PAUSE&amp;#39;)&#xA;&#xA;# 処理を実行するたびに1秒待機&#xA;pyautogui.PAUSE = 0.5&#xA;&#xA;# 画面のサイズを取得&#xA;width, height = pyautogui.size()&#xA;&#xA;# 指定の位置にカーソルを移動&#xA;pyautogui.moveTo(100, 400, duration=2)&#xA;&#xA;# 現在のカーソルの位置で左クリックを1回&#xA;pyautogui.click(button=&amp;#34;left&amp;#34;)&#xA;&#xA;# 順番にキーを押す処理を繰り返す&#xA;num = 0&#xA;end_num = 10&#xA;&#xA;while num &amp;lt; end_num:&#xA;    if keyboard.is_pressed(&amp;#34;shift&amp;#34;):&#xA;        print(&amp;#34;SHIFTキーが押されたので中断します。&amp;#34;)&#xA;        os.system(&amp;#39;PAUSE&amp;#39;)&#xA;&#xA;    print(str(num+1)+&amp;#34;回目の処理を実行中です。（SHIFTキーで停止）&amp;#34;)&#xA;    pyautogui.press(&amp;#34;e&amp;#34;)&#xA;    pyautogui.hotkey(&amp;#34;ctrl&amp;#34;, &amp;#34;s&amp;#34;)&#xA;    pyautogui.press(&amp;#34;j&amp;#34;)&#xA;    num += 1&#xA;&#xA;    if num == end_num:&#xA;        print(&amp;#34;処理が終わりました。同じ処理を繰り返しますか？&amp;#34;)&#xA;        os.system(&amp;#39;PAUSE&amp;#39;)&#xA;        num = 0&#xA;        continue&#xA;&#xA;print(&amp;#34;処理が終わりました。&amp;#34;)&#xA;&#xA;# 一時停止&#xA;os.system(&amp;#39;PAUSE&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;pyファイルを実行&#34;&gt;pyファイルを実行&#xA;&lt;/h2&gt;&lt;h3 id=&#34;pyファイルを直接実行したい場合&#34;&gt;pyファイルを直接実行したい場合&#xA;&lt;/h3&gt;&lt;p&gt;ファイルをダブルクリックします。&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;Pythonスクリプト実行中の画面&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;309px&#34; data-flex-grow=&#34;128&#34; height=&#34;497&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2023/01/pyautoguipython%E3%81%A7windows%E3%81%AE%E3%83%9E%E3%82%A6%E3%82%B9%E3%81%A8%E3%82%AD%E3%83%BC%E3%83%9C%E3%83%BC%E3%83%89%E3%82%92%E6%93%8D%E4%BD%9C%E3%81%99%E3%82%8B/images/No-04.jpg&#34; width=&#34;641&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;コマンドプロンプトから実行したい場合&#34;&gt;コマンドプロンプトから実行したい場合&#xA;&lt;/h3&gt;&lt;p&gt;コマンドプロンプトからpyファイルを呼び出せば、記載されたスクリプトが実行されます。例えば、&lt;strong&gt;test.py&lt;/strong&gt;というファイルが&lt;strong&gt;Cドライブ直下&lt;/strong&gt;にあったとしたら、以下のようになります。&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;python c:\test.py&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;処理を中断したいとき&#34;&gt;処理を中断したいとき&#xA;&lt;/h3&gt;&lt;p&gt;誤った操作になってしまったときは、Pythonの画面でキーボードのPAUSEを押下すると一時停止。Python及びコマンドプロンプトでCtrl+Cを押すと終了させることができます。&lt;/p&gt;&#xA;&lt;h2 id=&#34;excelなどでも使えそう&#34;&gt;Excelなどでも使えそう&#xA;&lt;/h2&gt;&lt;p&gt;今回、Kintone（キントーン）上で繰り返しキー操作を行うためにこのスクリプトを使いましたが、Excel（エクセル）やWindows上で自動で繰り返し行いたい作業がある場合に使えそうです。&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>【Python】マウスカーソルの座標とキーコードを取得するスクリプト</title>
            <link>https://qwerty.work/post/2023/01/python%E3%83%9E%E3%82%A6%E3%82%B9%E3%82%AB%E3%83%BC%E3%82%BD%E3%83%AB%E3%81%AE%E5%BA%A7%E6%A8%99%E3%81%A8%E3%82%AD%E3%83%BC%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E5%8F%96%E5%BE%97/</link>
            <pubDate>Wed, 11 Jan 2023 00:00:00 +0000</pubDate>
            <guid>https://qwerty.work/post/2023/01/python%E3%83%9E%E3%82%A6%E3%82%B9%E3%82%AB%E3%83%BC%E3%82%BD%E3%83%AB%E3%81%AE%E5%BA%A7%E6%A8%99%E3%81%A8%E3%82%AD%E3%83%BC%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E5%8F%96%E5%BE%97/</guid>
            <description>&lt;h2 id=&#34;マウスカーソルの座標が知りたい&#34;&gt;マウスカーソルの座標が知りたい&#xA;&lt;/h2&gt;&lt;p&gt;Windowsの操作をPythonで自動化するために座標が欲しい。といったときに、マウスカーソルの位置を取得するフリーソフトはありますが、あまりそういうのは入れたくないのですが、Pythonは入っているときに使えるものを見つけました。&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://irohaplat.com/python-mouse-coordinates-and-keycode-sample/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://irohaplat.com/python-mouse-coordinates-and-keycode-sample/&#34; alt=&#34;https://irohaplat.com/python-mouse-coordinates-and-keycode-sample/&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://irohaplat.com/python-mouse-coordinates-and-keycode-sample/&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://irohaplat.com/python-mouse-coordinates-and-keycode-sample/&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;p&gt;上記のサイトにあるスクリプトをコピペして実行するだけで簡単にできました。めちゃ便利です。&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;マウスカーソルの座標を表示している画面&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;616px&#34; data-flex-grow=&#34;256&#34; height=&#34;172&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2023/01/python%E3%83%9E%E3%82%A6%E3%82%B9%E3%82%AB%E3%83%BC%E3%82%BD%E3%83%AB%E3%81%AE%E5%BA%A7%E6%A8%99%E3%81%A8%E3%82%AD%E3%83%BC%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E5%8F%96%E5%BE%97/images/No-00.png&#34; width=&#34;442&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;使用しているライブラリについて&#34;&gt;使用しているライブラリについて&#xA;&lt;/h2&gt;&lt;p&gt;ここで使用されているPythonのライブラリのうち、&lt;strong&gt;tkinter&lt;/strong&gt;と&lt;strong&gt;ctypes&lt;/strong&gt;は標準ライブラリなので、インストール不要ですが、&lt;strong&gt;pyautogui&lt;/strong&gt;はインストールが必要です。&lt;/p&gt;&#xA;&lt;h3 id=&#34;インストールコマンド&#34;&gt;インストールコマンド&#xA;&lt;/h3&gt;&lt;p&gt;コマンドプロンプトから以下のコマンドでインストールできます。&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;pip install pyautogui&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;ライブラリを確認するコマンド&#34;&gt;ライブラリを確認するコマンド&#xA;&lt;/h3&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;pip list&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
        </item><item>
            <title>Windows版のPythonをインストールする手順</title>
            <link>https://qwerty.work/post/2023/01/windows%E7%89%88%E3%81%AEpython%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%89%8B%E9%A0%86/</link>
            <pubDate>Wed, 11 Jan 2023 00:00:00 +0000</pubDate>
            <guid>https://qwerty.work/post/2023/01/windows%E7%89%88%E3%81%AEpython%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%89%8B%E9%A0%86/</guid>
            <description>&lt;h2 id=&#34;インストーラーのダウンロード&#34;&gt;インストーラーのダウンロード&#xA;&lt;/h2&gt;&lt;p&gt;Python公式サイトの &lt;a class=&#34;link&#34; href=&#34;https://www.python.org/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;ダウンロードページ&lt;/a&gt; はちょっとわかりにくいので、&lt;a class=&#34;link&#34; href=&#34;https://pythonlinks.python.jp/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;以下ののページ&lt;/a&gt; からWindows用インストーラをダウンロードします。&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://pythonlinks.python.jp/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://pythonlinks.python.jp/&#34; alt=&#34;https://pythonlinks.python.jp/&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://pythonlinks.python.jp/&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://pythonlinks.python.jp/&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;h2 id=&#34;インストール手順&#34;&gt;インストール手順&#xA;&lt;/h2&gt;&lt;p&gt;ダウンロードしたファイルを実行&lt;/p&gt;&#xA;&lt;p&gt;**「Add python.exe to PATH」&lt;strong&gt;にチェックを入れて、&lt;/strong&gt;「Customaize installation」**をクリック&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;「Add python.exe to PATH」にチェックを入れて、「Customaize installation」をクリック&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;376px&#34; data-flex-grow=&#34;156&#34; height=&#34;450&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2023/01/windows%E7%89%88%E3%81%AEpython%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%89%8B%E9%A0%86/images/SnapCrab_Python-3111-64-bit-Setup_2023-1-11_10-36-24_No-00.jpg&#34; width=&#34;706&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;そのまま次へ&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;Python Install Optional Features&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;376px&#34; data-flex-grow=&#34;156&#34; height=&#34;450&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2023/01/windows%E7%89%88%E3%81%AEpython%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%89%8B%E9%A0%86/images/SnapCrab_Python-3111-64-bit-Setup_2023-1-11_10-37-17_No-00.jpg&#34; width=&#34;706&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;**「Install Python 3.11 for All users」&lt;strong&gt;にチェックを入れて&lt;/strong&gt;「Install」**をクリック&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;「Install Python 3.11 for All users」にチェックを入れて「Install」をクリック&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;376px&#34; data-flex-grow=&#34;156&#34; height=&#34;450&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2023/01/windows%E7%89%88%E3%81%AEpython%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%89%8B%E9%A0%86/images/SnapCrab_Python-3111-64-bit-Setup_2023-1-11_10-37-42_No-00.jpg&#34; width=&#34;706&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;インストールが終わるのを待つ。&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;Python インストール中の画面 Setup Progress &#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;376px&#34; data-flex-grow=&#34;156&#34; height=&#34;450&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2023/01/windows%E7%89%88%E3%81%AEpython%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%89%8B%E9%A0%86/images/Python-3111-64-bit-Setup.jpg&#34; width=&#34;706&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;インストール完了。**「Close」**をクリックして画面を閉じる。&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;Python Setup was successful&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;376px&#34; data-flex-grow=&#34;156&#34; height=&#34;450&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2023/01/windows%E7%89%88%E3%81%AEpython%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%89%8B%E9%A0%86/images/Python-3111-64-bit-Setup_2023-1-11_10-38-49_No-00.jpg&#34; width=&#34;706&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;正常にインストールされたか確認する&#34;&gt;正常にインストールされたか確認する&#xA;&lt;/h2&gt;&lt;p&gt;コマンドプロンプトを起動して&lt;code&gt;python&lt;/code&gt;と入力してEnter。以下のように表示されればOK。&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;コマンドプロンプトで正常にPythonがインストールできているか確認&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;326px&#34; data-flex-grow=&#34;135&#34; height=&#34;478&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2023/01/windows%E7%89%88%E3%81%AEpython%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%89%8B%E9%A0%86/images/SnapCrab_%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89-%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88-python_2023-1-11_10-39-37_No-00.jpg&#34; width=&#34;650&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;以下の画面が表示される場合&#34;&gt;以下の画面が表示される場合&#xA;&lt;/h3&gt;&lt;p&gt;パスが通っていない場合は以下のMicrosoftストアのPythonの画面が表示されます。この場合は手動でパスを登録すれば解決できます。&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;Microsoft-Store Python&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;337px&#34; data-flex-grow=&#34;140&#34; height=&#34;498&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2023/01/windows%E7%89%88%E3%81%AEpython%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%89%8B%E9%A0%86/images/SnapCrab_Microsoft-Store_2023-1-11_10-40-22_No-00.jpg&#34; width=&#34;700&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;pathを登録する手順&#34;&gt;PATHを登録する手順&#xA;&lt;/h2&gt;&lt;p&gt;パスが通っていない場合は以下の手順で、Windowsにパスを追加します。&lt;/p&gt;&#xA;&lt;p&gt;Windowsの**[設定]-[システム]&lt;strong&gt;にある&lt;/strong&gt;「システムの詳細設定」**を開く。&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;Windows 設定 - システム&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;431px&#34; data-flex-grow=&#34;179&#34; height=&#34;389&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2023/01/windows%E7%89%88%E3%81%AEpython%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%89%8B%E9%A0%86/images/SnapCrab_%E8%A8%AD%E5%AE%9A_2023-1-11_10-40-57_No-00.jpg&#34; width=&#34;700&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;システムのプロパティの画面で**「詳細設定」&lt;strong&gt;タブを選択し&lt;/strong&gt;「環境変数」**を開く。&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;システムのプロパティ&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;219px&#34; data-flex-grow=&#34;91&#34; height=&#34;578&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2023/01/windows%E7%89%88%E3%81%AEpython%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%89%8B%E9%A0%86/images/SnapCrab_%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0%E3%81%AE%E3%83%97%E3%83%AD%E3%83%91%E3%83%86%E3%82%A3_2023-1-11_10-41-27_No-00.jpg&#34; width=&#34;529&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;環境変数の画面の**「システム環境変数」&lt;strong&gt;の欄にある&lt;/strong&gt;「PATH」&lt;strong&gt;を選択して&lt;/strong&gt;[編集]**ボタンを押します。&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;環境変数&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;252px&#34; data-flex-grow=&#34;105&#34; height=&#34;625&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2023/01/windows%E7%89%88%E3%81%AEpython%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%89%8B%E9%A0%86/images/SnapCrab_%E7%92%B0%E5%A2%83%E5%A4%89%E6%95%B0_2023-1-11_10-41-54_No-00.jpg&#34; width=&#34;658&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;**[新規]**ボタンを押して以下の２つを登録します。&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;C:\Program File\Python311\&#xA;C:\Program File\Python311\Scrips\&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;上記のパスの階層やバージョンはご自分の環境に合わせて変更してください。&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;環境変数名の編集 - Pythonのパスを追加&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;251px&#34; data-flex-grow=&#34;104&#34; height=&#34;541&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://qwerty.work/post/2023/01/windows%E7%89%88%E3%81%AEpython%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%89%8B%E9%A0%86/images/SnapCrab_%E7%92%B0%E5%A2%83%E5%A4%89%E6%95%B0%E5%90%8D%E3%81%AE%E7%B7%A8%E9%9B%86_2023-1-11_10-42-50_No-00.jpg&#34; width=&#34;567&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;最後に**[OK]**を押したら完了です。もう一度、コマンドプロンプトで&lt;code&gt;python&lt;/code&gt;と打って起動を確認してみましょう。&lt;/p&gt;&#xA;</description>
        </item></channel>
</rss>
