<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>inarizuuuushi</author_name>
  <author_url>https://blog.hatena.ne.jp/inarizuuuushi/</author_url>
  <blog_title>Sabrou-mal サブロウ丸</blog_title>
  <blog_url>https://inarizuuuushi.hatenablog.com/</blog_url>
  <categories>
    <anon> python </anon>
    <anon>Linuxコマンド</anon>
  </categories>
  <description>subprocess シェルの中で他のプログラムを起動し、そのプログラムが生成した出力を知りたいだけなら、getoutput()関数を使う。 import subprocess as sp ls = sp.getoutput('ls') ls &gt; 'Applications\nDesktop\nDocuments\n...(略)' オプションとパイプ、リダイレクトを入れることも可能。 ls_l = sp.getoutpu('ls -a') ls_l &gt; '.\n..\n.Backup\n...(略)' ls = sp.getoutput('ls | wc') ls &gt; ' 27 27 263'…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Finarizuuuushi.hatenablog.com%2Fentry%2F2017%2F01%2F08%2F153252&quot; title=&quot;Pythonスクリプト内でシェルコマンドを使う - Sabrou-mal サブロウ丸&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-01-08 15:32:52</published>
  <title>Pythonスクリプト内でシェルコマンドを使う</title>
  <type>rich</type>
  <url>https://inarizuuuushi.hatenablog.com/entry/2017/01/08/153252</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
