How can I perform a ping or traceroute using native python?

后端 未结 7 1762
走了就别回头了
走了就别回头了 2021-01-05 14:56

I would like to be able to perform a ping and traceroute from within Python without having to execute the corresponding shell commands so I\'d prefer a native python solutio

7条回答
  •  误落风尘
    2021-01-05 15:51

    I wrote a simple tcptraceroute in python which does not need root privileges http://www.thomas-guettler.de/scripts/tcptraceroute.py.txt

    But it can't display the IP addresses of the intermediate hops. But sometimes it is useful, since you can guess where the blocking firewall is: Either at the beginning or at the end of the route.

提交回复
热议问题