![]() |
Test internet connection - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: General (https://python-forum.io/forum-1.html) +--- Forum: Code sharing (https://python-forum.io/forum-5.html) +--- Thread: Test internet connection (/thread-458.html) Pages:
1
2
|
RE: Test internet connection - wavic - Oct-13-2016 (Oct-13-2016, 02:54 PM)micseydel Wrote: I ping 8.8.8.8, since it's a DNS server and tends to be very reliable. How do you ping with python? Scapy? RE: Test internet connection - Skaperen - Oct-13-2016 (Oct-13-2016, 02:54 PM)micseydel Wrote: I ping 8.8.8.8, since it's a DNS server and tends to be very reliable. 2001:4860:4860::8888 is the same machine. (Oct-13-2016, 03:10 PM)wavic Wrote:(Oct-13-2016, 02:54 PM)micseydel Wrote: I ping 8.8.8.8, since it's a DNS server and tends to be very reliable. another way is with subprocess. RE: Test internet connection - wavic - Oct-14-2016 (Oct-13-2016, 11:40 PM)Skaperen Wrote:I don't like to use subprocess.(Oct-13-2016, 02:54 PM)micseydel Wrote: I ping 8.8.8.8, since it's a DNS server and tends to be very reliable. RE: Test internet connection - Skaperen - Oct-14-2016 (Oct-14-2016, 02:18 AM)wavic Wrote: I don't like to use subprocess.is there some knowledge base around this that i do not have? RE: Test internet connection - snippsat - Oct-14-2016 (Oct-14-2016, 03:08 AM)Skaperen Wrote:Yes subprocess is top secret stuff :silenced:(Oct-14-2016, 02:18 AM)wavic Wrote: I don't like to use subprocess.is there some knowledge base around this that i do not have? import subprocess website = "google.com" ping = subprocess.Popen(["ping", website], stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, error = ping.communicate() print(out.decode('utf-8'))
|