<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>takuya_1st</author_name>
  <author_url>https://blog.hatena.ne.jp/takuya_1st/</author_url>
  <blog_title>それマグで！</blog_title>
  <blog_url>https://takuya-1st.hatenablog.jp/</blog_url>
  <categories>
    <anon>python</anon>
  </categories>
  <description>起動して入力をわたしたい。 cmd1= &quot;cat&quot; p = subprocess.Popen(cmd1.strip().split(&quot; &quot;), stdin=subprocess.PIPE) p.stdin.write(&quot;Hello World\n&quot;.encode('utf8')) コマンドを起動するときに、 stdin に PIPEを指定する。実行中の python と サブプロセスのSTDINを繋いでやる。 これで p.write が呼べる 複数パイプしたいとき 複数パイプの起動をしたいときは、こちらのエントリに書きました。 python でコマンド実行。サブプロセスの終了待ち・強制終了・親…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakuya-1st.hatenablog.jp%2Fentry%2F2017%2F04%2F03%2F223506&quot; title=&quot; python の subprocess 起動で、起動コマンドのstdin に書き込む - それマグで！&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>2017-04-03 22:35:06</published>
  <title> python の subprocess 起動で、起動コマンドのstdin に書き込む</title>
  <type>rich</type>
  <url>https://takuya-1st.hatenablog.jp/entry/2017/04/03/223506</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
