<legend id='qCObW'><style id='qCObW'><dir id='qCObW'><q id='qCObW'></q></dir></style></legend>

<small id='qCObW'></small><noframes id='qCObW'>

    <tfoot id='qCObW'></tfoot>

          <bdo id='qCObW'></bdo><ul id='qCObW'></ul>
        <i id='qCObW'><tr id='qCObW'><dt id='qCObW'><q id='qCObW'><span id='qCObW'><b id='qCObW'><form id='qCObW'><ins id='qCObW'></ins><ul id='qCObW'></ul><sub id='qCObW'></sub></form><legend id='qCObW'></legend><bdo id='qCObW'><pre id='qCObW'><center id='qCObW'></center></pre></bdo></b><th id='qCObW'></th></span></q></dt></tr></i><div id='qCObW'><tfoot id='qCObW'></tfoot><dl id='qCObW'><fieldset id='qCObW'></fieldset></dl></div>
      1. 用 Python ping 一个站点?

        Ping a site in Python?(用 Python ping 一个站点?)
      2. <tfoot id='5Im0C'></tfoot>

          <legend id='5Im0C'><style id='5Im0C'><dir id='5Im0C'><q id='5Im0C'></q></dir></style></legend>
                <tbody id='5Im0C'></tbody>

                <i id='5Im0C'><tr id='5Im0C'><dt id='5Im0C'><q id='5Im0C'><span id='5Im0C'><b id='5Im0C'><form id='5Im0C'><ins id='5Im0C'></ins><ul id='5Im0C'></ul><sub id='5Im0C'></sub></form><legend id='5Im0C'></legend><bdo id='5Im0C'><pre id='5Im0C'><center id='5Im0C'></center></pre></bdo></b><th id='5Im0C'></th></span></q></dt></tr></i><div id='5Im0C'><tfoot id='5Im0C'></tfoot><dl id='5Im0C'><fieldset id='5Im0C'></fieldset></dl></div>
                • <bdo id='5Im0C'></bdo><ul id='5Im0C'></ul>
                • <small id='5Im0C'></small><noframes id='5Im0C'>

                  本文介绍了用 Python ping 一个站点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何使用 Python ping 网站或 IP 地址?

                  How do I ping a website or IP address with Python?

                  推荐答案

                  看这个 纯 Python ping 由 Matthew Dixon Cowles 和 Jens Diemer.另外,请记住 Python 需要 root 才能在 linux 中生成 ICMP(即 ping)套接字.

                  See this pure Python ping by Matthew Dixon Cowles and Jens Diemer. Also, remember that Python requires root to spawn ICMP (i.e. ping) sockets in linux.

                  import ping, socket
                  try:
                      ping.verbose_ping('www.google.com', count=3)
                      delay = ping.Ping('www.wikipedia.org', timeout=2000).do()
                  except socket.error, e:
                      print "Ping Error:", e
                  

                  源代码本身很容易阅读,请参阅 verbose_pingPing.do 的实现以获得灵感.

                  The source code itself is easy to read, see the implementations of verbose_ping and of Ping.do for inspiration.

                  这篇关于用 Python ping 一个站点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  groupby multiple coords along a single dimension in xarray(在xarray中按单个维度的多个坐标分组)
                  Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)
                  Group by + New Column + Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)
                  Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)
                  Pandas - Group Rows based on a column and replace NaN with non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)
                  Grouping pandas DataFrame by 10 minute intervals(按10分钟间隔对 pandas 数据帧进行分组)

                      <small id='hLZYM'></small><noframes id='hLZYM'>

                      <i id='hLZYM'><tr id='hLZYM'><dt id='hLZYM'><q id='hLZYM'><span id='hLZYM'><b id='hLZYM'><form id='hLZYM'><ins id='hLZYM'></ins><ul id='hLZYM'></ul><sub id='hLZYM'></sub></form><legend id='hLZYM'></legend><bdo id='hLZYM'><pre id='hLZYM'><center id='hLZYM'></center></pre></bdo></b><th id='hLZYM'></th></span></q></dt></tr></i><div id='hLZYM'><tfoot id='hLZYM'></tfoot><dl id='hLZYM'><fieldset id='hLZYM'></fieldset></dl></div>

                        <tfoot id='hLZYM'></tfoot>
                        <legend id='hLZYM'><style id='hLZYM'><dir id='hLZYM'><q id='hLZYM'></q></dir></style></legend>

                            <bdo id='hLZYM'></bdo><ul id='hLZYM'></ul>
                              <tbody id='hLZYM'></tbody>