<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>karasuyamatengu</author_name>
  <author_url>https://blog.hatena.ne.jp/karasuyamatengu/</author_url>
  <blog_title>karasuyamatenguの日記</blog_title>
  <blog_url>https://karasuyamatengu.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>Pythonからコマンドを操るモジュールをsubprocessの使い方を整理してみた。前半はマニュアルをなぞっている http://docs.python.org/library/subprocess.html subprocessはos.system, os.spawn, os.popen, popen2, commandsなどのモジュールに取って代る位置付けだとは知らなかった。マニュアルは読んでみるものだ。コードはreplにコピペすると(Unix的OSなら)動くはず。準備 import sys,os from subprocess import * コマンドからの出力を捕える 標準出力、標…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkarasuyamatengu.hatenadiary.org%2Fentry%2F20110210%2F1297325456&quot; title=&quot;Python subprocess - karasuyamatenguの日記&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>2011-02-10 17:10:56</published>
  <title>Python subprocess</title>
  <type>rich</type>
  <url>https://karasuyamatengu.hatenadiary.org/entry/20110210/1297325456</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
