Python multithreading "ping"
Question: I have been trying to make a python script that will ask you for a IP and have
many simultaneous PING i shall do.

But it seems like i can only run one PING at a time

I'm running on OSX

    
    
    import _thread
    import os
    import time
    
    def main():
    
        threadnbr = 0
    
        ip = str(input("Input the ip adresse to play with? "))
        threads = int(input("Have many threads? "))
    
        check(ip)
    
        if check(ip) == 0:
            print("It is up")
        else:
            print("Is is down")
    
        thread(ip, threads, threadnbr)
    
    def thread(ip, threads, threadnbr):
    
        while threads > threadnbr:
    
            _thread.start_new_thread(dos(ip))
    
            threadnbr = threadnbr + 1
    
        else:
            print(threadnbr, " started")
    
    def check(ip):
    
        response = os.system("ping -c 1 " + ip)
    
        return response
    
    def dos(ip):
    
        os.system("ping -i 0.1 -s 8000 " + ip)
        print("1")
    
    main()
    


Answer: 
    _thread.start_new_thread(dos(ip))
    

You are not providing the arguments correctly here - your code is running in
the main thread. See [the
documentation](https://docs.python.org/2/library/thread.html#thread.start_new_thread)
for more details.

Also, you should be using `threading` instead of `thread`. That module is
deprecated.

If `dos` means `DoS`, I sincerely hope you're doing this for educational
purposes against your own infrastructure.

