<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kuku81kuku81</author_name>
  <author_url>https://blog.hatena.ne.jp/kuku81kuku81/</author_url>
  <blog_title>Django Girls and Boys 備忘録</blog_title>
  <blog_url>https://kuku81kuku81.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>PythonからWindowsの.exeファイルを実行したい場面があるかもしれません。例えば、Pythonスクリプトの中から自動的に外部プログラムを起動して、特定のタスクを実行させたい場合です。そんなときに便利なのが、Python標準ライブラリのsubprocessモジュールです。 今回は、subprocess.run()関数を使って、Pythonからexeファイルを実行する方法を紹介します。 １．基本的な使用方法 subprocess.run()関数は、外部のプログラムを実行し、そのプログラムが終了するまで待つ便利な方法です。まずは、簡単な例を見てみましょう。 Pythonから実行する.ex…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkuku81kuku81.hatenablog.com%2Fentry%2F2024%2F10%2F07_Python_how_to_run_an_exe_file&quot; title=&quot;【Python】exeファイルを実行する方法：subprocess.run()を使った簡単な手順 - Django Girls and Boys 備忘録&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/k/kuku81kuku81/20220605/20220605115219.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2024-10-07 19:00:00</published>
  <title>【Python】exeファイルを実行する方法：subprocess.run()を使った簡単な手順</title>
  <type>rich</type>
  <url>https://kuku81kuku81.hatenablog.com/entry/2024/10/07_Python_how_to_run_an_exe_file</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
