Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a program that Ping a list of IP #302

Open
skaailet opened this issue Mar 25, 2020 · 2 comments
Open

Create a program that Ping a list of IP #302

skaailet opened this issue Mar 25, 2020 · 2 comments

Comments

@skaailet
Copy link

Hi,
Im new in this coding field
im trying to create a program that Ping a list of IPs that i have on a text file and saves the output result into another textfile
, but im not able to do it

the code that i use is this one

`import subprocess

with open('ip2.txt' ,encoding="utf-8") as f,open('ip_out.txt', 'wb') as f_out:
for adress in f:
adress = adress.strip()
response = subprocess.run(['ping', adress], capture_output=True)
print(response.stdout.decode())
f_out.write(response.stdout)`

@ghost
Copy link

ghost commented Mar 28, 2020

hi @skaailet you might find this useful!
Clone this
https://github.com/caesar-cipher/utility.git

And the code you need is in /ping .
Hope this helps!

saurabh896 added a commit to saurabh896/python-1 that referenced this issue May 8, 2020
Program to check if host pinging or not
saurabh896 added a commit to saurabh896/python-1 that referenced this issue May 8, 2020
@saurabh896
Copy link

@skaailet Please check this commit I made a program in Python you just need to Add IP host in the Txt file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants