<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>shinshin86</author_name>
  <author_url>https://blog.hatena.ne.jp/shinshin86/</author_url>
  <blog_title>at backyard</blog_title>
  <blog_url>https://shinshin86.hateblo.jp/</blog_url>
  <categories>
    <anon>Windows</anon>
    <anon>subprocess</anon>
    <anon>Python</anon>
    <anon>備忘録</anon>
  </categories>
  <description>Windows環境でsubprocess.Popenでファイルを開こうとすると【[WinError 2] 指定されたファイルが見つかりません】というエラーがでる MacとWindowsどちらにも対応したアプリを書いていて、とある処理でPythonのsubprocess.Popenを使って指定したファイルを開く処理を書いた際に躓いたこととその解決法に関するメモとなる。 import subprocess import os from os import path ・ ・ ・ file_path = path.join(os.getcwd(), 'foo.txt') if os_name == &quot;…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fshinshin86.hateblo.jp%2Fentry%2F2022%2F01%2F19%2F000000&quot; title=&quot; Pythonのsubprocess.Popenでファイルを開こうとすると【[WinError 2] 指定されたファイルが見つかりません】 - at backyard&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-01-19 00:00:00</published>
  <title> Pythonのsubprocess.Popenでファイルを開こうとすると【[WinError 2] 指定されたファイルが見つかりません】</title>
  <type>rich</type>
  <url>https://shinshin86.hateblo.jp/entry/2022/01/19/000000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
