You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)`
The text was updated successfully, but these errors were encountered:
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)`
The text was updated successfully, but these errors were encountered: