How can I have this script exucute a .exe file instead of beeping the system
speaker?
__________________________________________

import os
import time

z = 2

while z ==2:

    connected = False
    while not connected:
        o=os.popen("netstat -an")
        for l in o:
            try:
                if l.split()[1].endswith("159.215.49.8.116:59999"):
                    print "\a\a\a\a\aMatch!"
                    connected = True
                else:
                    print "Nothing"
            except IndexError:
                print "Index Exception"
        time.sleep(1)

    amount=0
    while connected:
        o=os.popen("netstat -an")
        for l in o:
            try:
                if l.split()[1].endswith("159.215.49.8:59999"):
                    print "Still There"
                    connected = True
                    amount +=1
                    print amount
                else:
                    print "Nothing"
            except IndexError:
                print "Index Exception"
        time.sleep(1)
        if amount == 1:
            amount -=1
        else:
            print "It's Gone"
            connected = False

    print "\a\a"

raw_input("Press Enter to close")
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to