Q: Python cannot use scapy run ping on windows server I run python on Windows server to ping host with scapy like this code.
from scapy.all import *

    def check_down():
        ip = ['192.168.1.111']
        for w in ip:  
            resp = sr1(IP(dst=w)/ICMP(),timeout=10)

            if resp == None:
                print("This host is down " + w)
                time.sleep(10*60)

    while True:

        check_down()

When I run this code it shows error:
    Begin emission:
Finished sending 1 packets.
Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\thingspeak_line.py", line 98, in <module>
    check_down()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\thingspeak_line.py", line 83, in check_down
    resp = sr1(IP(dst=w.rstrip())/ICMP(),timeout=10)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\scapy\sendrecv.py", line 489, in sr1
    ans, _ = sndrcv(s, x, *args, **kargs)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\scapy\sendrecv.py", line 261, in sndrcv
    sndrcver = SndRcvHandler(*args, **kwargs)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\scapy\sendrecv.py", line 136, in __init__
    self._sndrcv_rcv(snd_thread.start)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\scapy\sendrecv.py", line 243, in _sndrcv_rcv
    self.sniffer._run(
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\scapy\sendrecv.py", line 925, in _run
    session.on_packet_received(p)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\scapy\sessions.py", line 47, in on_packet_received
    result = self.prn(pkt)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\scapy\sendrecv.py", line 219, in _process_packet
    os.write(1, b"*")
OSError: [Errno 9] Bad file descriptor

It have no error when I run on Windows 10. I want to ping many host. How can I fix it?
