[Tutor] how to get the confirmation that a cmd done using os.system is corectely done?

kbond kbond@free.fr
Sun Feb 23 05:28:01 2003


   
Hello,

I have a problem in Onconnect() function (I put the code bellow). This 
function is called by an event in a menu.
The goal of this function is to connect my linux box to the internet. 
The connection works fine, my problem is that during the connection the 
application informs the user on the status of the connection. I want to 
display the message ("The computer is connected to internet") in a 
wxStaticText when the command "pon Free_Telecom" is succesfully finish.
I am attaching the complete code to this mail.
Any suggestion to improve it are welcome.

Regards,

Yann




def OnConnect(self, e):
        import os
        import time
        print "debut de la fonction OnConnect"       
        self.statTxt.SetLabel("Connecting to internet")
        print self.statTxt.GetLabel()   
        os.system("pon Free_Telecom")
        time.sleep(5)
        self.statTxt.SetLabel("The computer is connected to internet")
        self.connectedFlag = 1
        print "fin de la fonction OnConnect"
        print self.connectedFlag