<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>a2c</author_name>
  <author_url>https://blog.hatena.ne.jp/a2c/</author_url>
  <blog_title>When it’s ready.</blog_title>
  <blog_url>https://a2c.hatenablog.com/</blog_url>
  <categories>
    <anon>python</anon>
  </categories>
  <description>pythonからコマンド呼んでその返り値も利用して何かしたくなった。 sh使った方が良いとかそういう話もありますが、まぁpythonで。 commandsという便利そうな野があったので使ってみました。サンプルで、適当な範囲のIPから返答があるかどうか調べて、OK/NGを返すだけのスクリプト pingコマンドに回数指定しないと、延々返ってこない。 #!/usr/bin/env python # coding:utf-8 import commands ip_base = '10.0.0' start_ip = 10 ip_range = 5 for i in range(ip_range): i…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fa2c.hatenablog.com%2Fentry%2F20091117%2F1258385287&quot; title=&quot;pythonからコマンド呼ぶ - When it’s ready.&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>2009-11-17 00:28:07</published>
  <title>pythonからコマンド呼ぶ</title>
  <type>rich</type>
  <url>https://a2c.hatenablog.com/entry/20091117/1258385287</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
