Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Network Pinging with Python

Tags:

python

request

Is there a way i can ping requests of a particular website for a particular no. of times using Python and also is there a way through which i can decide the no . of packets of data to be send in each request ?

like image 986
user2621913 Avatar asked Nov 02 '22 17:11

user2621913


1 Answers

You can use the os module for this.

5 is the count www.examplesite.com is the site

import os

os.system("ping -c 5 www.examplesite.com")

Hope it helped

like image 148
Bhargav Ponnapalli Avatar answered Nov 15 '22 05:11

Bhargav Ponnapalli