please help me on this program, the program "crashes"

what could be the problem here? please help me in
debugging the program. attached is the program code.

i think the problem lies here, since when i added this
part, when i click the start button, the program hangs
and does not respond, but still creates the text files
created by clicking the start button.

the program is a GUI that controls an external
hardware. i am using BOA 0.3.1 w/ wxPython 2.4.2.4.

please help!!!

def OnStartButton(self, event):
        
        self.flag = 1
        
        output_file =
open(os.path.join(self.SaveFolder.GetValue(),'info.txt'),
'w')
        output_file.write('Date:\t\t\t')
        output_file.write(self.maskedDate.GetValue())
        output_file.write('\nPV Type:\t\t')
       
output_file.write(self.maskedPVType.GetValue())
        output_file.write('\nNominal Peak Power:\t')
       
output_file.write(self.maskedNomPeakPow.GetValue())
        output_file.write('\nMinimum Power:\t\t')
       
output_file.write(self.maskedMinPow.GetValue())
        output_file.write('\nPeak Power Voltage:\t')
       
output_file.write(self.maskedPeakPowVolt.GetValue())
        output_file.write('\nPeak Power Current:\t')
       
output_file.write(self.maskedPeakPowCurr.GetValue())
        output_file.write('\nOpen Circuit Voltage:\t')
       
output_file.write(self.maskedOpenCircVolt.GetValue())
        output_file.write('\nShort Circuit
Current:\t')
       
output_file.write(self.maskedShortCircCurr.GetValue())
        output_file.write('\nUser:\t\t\t')
        output_file.write(self.maskedUser.GetValue())
        output_file.close()
        
        self.ser.open()
        self.tx_command = 67
        self.tx_no_databyte = 2
        self.tx_message_no = 1
        self.tx_len = len (self.irradianceIntegers)
               
        self.counter = 0
        self.timer1.Start(5000)
                        
        self.count = 0
        self.temp1 = []
        self.temp2 = []
        self.pyra1 = []
        self.pyra2 = []
        self.voltage = []
        self.current = []
                   
        while(self.flag==1 or
self.count<=self.tx_len):
            
            rx_data = self.ser.read(19)
            rx_len = len(rx_data)
            byte = [ord(x) for x in rx_data]
            
            if rx_len < 10:
                sys.exit(1)
    
            for k in range (rx_len-9):
                if byte[k] == 70 and byte [k+2] == 6
and sum(byte[k:k+10]) & 0xff == 0:
                               
                    temp11 = float(byte[k+3])* 5/255
                    temp22 = float(byte[k+4])* 5/255
                    pyra11 = float(byte[k+5])* 5/255
                    pyra22 = float(byte[k+6])* 5/255
                    voltage11 = float(byte[k+7])*
5/255
                    current11 = float(byte[k+8])*
5/255
                    
                    self.temp1.append(temp11)
                    self.temp2.append(temp22)
                    self.pyra1.append(pyra11)
                    self.pyra2.append(pyra22)
                    self.voltage.append(voltage11)
                    self.current.append(current11)
                    
                    self.filename = "%s\%s.txt"
%(os.path.normpath(self.SaveFolder.GetValue()),time.strftime("%Y%m%d%H%M"))
                    self.table_file =
open(self.filename,"a")
                                              
self.table_file.write('%f\t'%temp11)
                   
self.table_file.write('%f\t'%temp22)
                   
self.table_file.write('%f\t'%pyra11)
                   
self.table_file.write('%f\t'%pyra22)
                   
self.table_file.write('%f\t'%voltage11)
                   
self.table_file.write('%f\t'%current11)
                    self.table_file.write('\n')
                    self.table_file.close()
                                                      
            #self.count = self.count+1
            #self.ser.flushInput()
        self.ser.close()
        
        #event.Skip()

    def OnStopButton(self, event):
        
        self.flag = 0
        self.timer1.Stop()
        del self.timer1
        self.ser.close()
        #event.Skip()

    def OnConstantModeRadiobutton(self, event):
        self.TextFile.Enable(False)
        self.BrowseTextFile.Enable(False)

    def OnUserModeRadiobutton(self, event):
        self.TextFile.Enable(True)
        self.BrowseTextFile.Enable(True)

    def OnTimer1Timer(self, event):
                
        #self.filename = "%s\%s.txt"
%(os.path.normpath(self.SaveFolder.GetValue()),time.strftime("%Y%m%d%H%M"))
                                
        self.data_hi, self.data_lo =
divmod(self.irradianceIntegers[self.counter], 0x100)
           
        self.tx_checksum = -(self.data_hi +
self.data_lo + self.tx_command + self.tx_message_no +
self.tx_no_databyte) & 0xff
        self.ser.write(pack('6B', self.tx_command,
self.tx_message_no, self.tx_no_databyte, self.data_lo,
self.data_hi, self.tx_checksum))
    
# if self.tx_len == self.counter:
# self.timer1.Stop()
# del self.timer1
# else:
        self.counter = self.counter +1
        
        return
        #event.Skip()

wxFrame1.py (22.6 KB)

wxApp1.py (463 Bytes)

···

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Hi Jan,

The attached files are not self contained, i.e. at least serial.py and Dialog1 are missing. Can you change the app so it uses some file objects instead of serial? If not can it be run with having nothing connected to the serial port? If either are possible I am willing to have a look at it, but don't get your hopes up I still might not be able to help as serial comms and tread stuff is not that easy (at least for me).

One suggestion move the following four lines:

        self.ser = serial.Serial()
        self.ser.baudrate = 9600
        self.ser.port = 0
        self.ser.timeout = 1

to either just before or even better after:
        self._init_ctrls(parent)

This way you don't get errors when trying to use the Boa Designer (i.e. you will not have to re-enter this code all the time.

See you
Werner

jan rienyer gadil wrote:

···

what could be the problem here? please help me in
debugging the program. attached is the program code.

i think the problem lies here, since when i added this
part, when i click the start button, the program hangs
and does not respond, but still creates the text files
created by clicking the start button.

the program is a GUI that controls an external
hardware. i am using BOA 0.3.1 w/ wxPython 2.4.2.4.

please help!!!

def OnStartButton(self, event):
              self.flag = 1
              output_file =
open(os.path.join(self.SaveFolder.GetValue(),'info.txt'),
'w')
       output_file.write('Date:\t\t\t')
       output_file.write(self.maskedDate.GetValue())
       output_file.write('\nPV Type:\t\t')
      output_file.write(self.maskedPVType.GetValue())
       output_file.write('\nNominal Peak Power:\t')
      output_file.write(self.maskedNomPeakPow.GetValue())
       output_file.write('\nMinimum Power:\t\t')
      output_file.write(self.maskedMinPow.GetValue())
       output_file.write('\nPeak Power Voltage:\t')
      output_file.write(self.maskedPeakPowVolt.GetValue())
       output_file.write('\nPeak Power Current:\t')
      output_file.write(self.maskedPeakPowCurr.GetValue())
       output_file.write('\nOpen Circuit Voltage:\t')
      output_file.write(self.maskedOpenCircVolt.GetValue())
       output_file.write('\nShort Circuit
Current:\t')
      output_file.write(self.maskedShortCircCurr.GetValue())
       output_file.write('\nUser:\t\t\t')
       output_file.write(self.maskedUser.GetValue())
       output_file.close()
              self.ser.open()
       self.tx_command = 67
       self.tx_no_databyte = 2
       self.tx_message_no = 1
       self.tx_len = len (self.irradianceIntegers)
                     self.counter = 0
       self.timer1.Start(5000)
                              self.count = 0
       self.temp1 =
       self.temp2 =
       self.pyra1 =
       self.pyra2 =
       self.voltage =
       self.current =
                         while(self.flag==1 or
self.count<=self.tx_len):
           
           rx_len = len(rx_data)
           byte = [ord(x) for x in rx_data]
                      if rx_len < 10:
               sys.exit(1)
              for k in range (rx_len-9):
               if byte[k] == 70 and byte [k+2] == 6
and sum(byte[k:k+10]) & 0xff == 0:
                                                 temp11 = float(byte[k+3])* 5/255
                   temp22 = float(byte[k+4])* 5/255
                   pyra11 = float(byte[k+5])* 5/255
                   pyra22 = float(byte[k+6])* 5/255
                   voltage11 = float(byte[k+7])*
5/255
                   current11 = float(byte[k+8])*
5/255
                                      self.temp1.append(temp11)
                   self.temp2.append(temp22)
                   self.pyra1.append(pyra11)
                   self.pyra2.append(pyra22)
                   self.voltage.append(voltage11)
                   self.current.append(current11)
                                      self.filename = "%s\%s.txt"
%(os.path.normpath(self.SaveFolder.GetValue()),time.strftime("%Y%m%d%H%M"))
                   self.table_file =
open(self.filename,"a")
                                             
                  self.table_file.write('%f\t'%temp11)
                  self.table_file.write('%f\t'%temp22)
                  self.table_file.write('%f\t'%pyra11)
                  self.table_file.write('%f\t'%pyra22)
                  self.table_file.write('%f\t'%voltage11)
                  self.table_file.write('%f\t'%current11)
                   self.table_file.write('\n') self.table_file.close()
                                                     
                   #self.count = self.count+1 #self.ser.flushInput()
       self.ser.close()
              #event.Skip()

   def OnStopButton(self, event):
              self.flag = 0
       self.timer1.Stop()
       del self.timer1
       self.ser.close()
       #event.Skip()

   def OnConstantModeRadiobutton(self, event):
       self.TextFile.Enable(False)
       self.BrowseTextFile.Enable(False)

   def OnUserModeRadiobutton(self, event):
       self.TextFile.Enable(True)
       self.BrowseTextFile.Enable(True)

   def OnTimer1Timer(self, event):
                      #self.filename = "%s\%s.txt"
%(os.path.normpath(self.SaveFolder.GetValue()),time.strftime("%Y%m%d%H%M"))
                                      self.data_hi, self.data_lo =
divmod(self.irradianceIntegers[self.counter], 0x100)
                 self.tx_checksum = -(self.data_hi +
self.data_lo + self.tx_command + self.tx_message_no +
self.tx_no_databyte) & 0xff
       self.ser.write(pack('6B', self.tx_command,
self.tx_message_no, self.tx_no_databyte, self.data_lo,
self.data_hi, self.tx_checksum))
   # if self.tx_len == self.counter:
# self.timer1.Stop()
# del self.timer1 # else:
       self.counter = self.counter +1
              return #event.Skip()
       
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

sir Werner,

I don’t think i can do that. Instead may i ask you some question regarding the program:

  1. on the

def OnStartButton(self, event):

would there be conflict between the

self.timer1.Start(5000) and the while() loop?

will the timer event still be executed even if the program is inside the while loop

  1. a flag is set when i click the stop and start button. will the flag still be set to 1 when i click the stop button even if the code is currently executing the while loop??

  2. would transferring this “self.filename = “%s%s.txt” %(os.path.normpath(self.SaveFolder.GetValue()),time.strftime(”%Y%m%d%H%M"))
    to the timer event, create a new file timer event???

thanks in advance…

···

“Werner F. Bruhin” werner.bruhin@free.fr wrote:

Hi Jan,
The attached files are not self contained, i.e. at least serial.py and
Dialog1 are missing. Can you change the app so it uses some file
objects instead of serial? If not can it be run with having nothing
connected to the serial port? If either are possible I am willing to
have a look at it, but don’t get your hopes up I still might not be able
to help as serial comms and tread stuff is not that easy (at least for me).
One suggestion move the following four lines:
self.ser = serial.Serial()
self.ser.baudrate = 9600
self.ser.port = 0
self.ser.timeout = 1
to either just before or even better after:
self._init_ctrls(parent)
This way you don’t get errors when trying to use the Boa Designer (i.e.
you will not have to re-enter this code all the time.
See you
Werner
jan rienyer gadil
wrote:

what could be the problem here? please help me in
debugging the program. attached is the program code.

i think the problem lies here, since when i added this
part, when i click the start button, the program hangs
and does not respond, but still creates the text files
created by clicking the start button.

the program is a GUI that controls an external
hardware. i am using BOA 0.3.1 w/ wxPython 2.4.2.4.

please help!!!

def OnStartButton(self, event):

self.flag = 1

output_file =
open(os.path.join(self.SaveFolder.GetValue(),‘info.txt’),
‘w’)
output_file.write(‘Date:\t\t\t’)
output_file.write(self.maskedDate.GetValue())
output_file.write(‘\nPV Type:\t\t’)

output_file.write(self.maskedPVType.GetValue())
output_file.write(‘\nNominal Peak Power:\t’)

output_file.write(self.maskedNomPeakPow.GetValue())
output_file.write(‘\nMinimum Power:\t\t’)

output_file.write(self.maskedMinPow.GetValue())
output_file.write(‘\nPeak Power Voltage:\t’)

output_file.write(self.maskedPeakPowVolt.GetValue())
output_file.write(‘\nPeak Power Current:\t’)

output_file.write(self.maskedPeakPowCurr.GetValue())
output_file.write(‘\nOpen Circuit Voltage:\t’)

output_file.write(self.maskedOpenCircVolt.GetValue())
output_file.write(‘\nShort Circuit
Current:\t’)

output_file.write(self.maskedShortCircCurr.GetValue())
output_file.write(‘\nUser:\t\t\t’)
output_file.write(self.maskedUser.GetValue())
output_file.close()

self.ser.open()
self.tx_command = 67
self.tx_no_databyte = 2
self.tx_message_no = 1
self.tx_len = len (self.irradianceIntegers)
__ >
self.counter = 0
self.timer1.Start(5000)

self.count = 0
self.temp1 =
self.temp2 =
self.pyra1 =
self.pyra2 =
self.voltage =
self.current =

while(self.flag==1 or
self.count<=self.tx_len):

rx_data = self.ser.read(19)
rx_len = len(rx_data)
byte = [ord(x) for x in rx_data]

if rx_len < 10:
sys.exit(1)

for k in range (rx_len-9):
if byte[k] == 70 and byte [k+2] == 6
and sum(byte[k:k+10]) & 0xff == 0:

temp11 = float(byte[k+3])* 5/255
temp22 = float(byte[k+4])* 5/255
pyra11 = float(byte[k+5])* 5/255
pyra22 = float(byte[k+6])* 5/255
voltage11 = float(byte[k+7])*
5/255
current11 = float(byte[k+8])*
5/255

self.temp1.append(temp11)
self.temp2.append(temp22)

self.pyra1.append(pyra11)

self.pyra2.append(pyra22)
self.voltage.append(voltage11)
self.current.append(current11)

self.filename = “%s%s.txt”
%(os.path.normpath(self.SaveFolder.GetValue()),time.strftime(“%Y%m%d%H%M”))
self.table_file =
open(self.filename,“a”)

self.table_file.write(‘%f\t’%temp11)

self.table_file.write(‘%f\t’%temp22)

self.table_file.write(‘%f\t’%pyra11)

self.table_file.write(‘%f\t’%pyra22)

self.table_file.write(‘%f\t’%voltage11)

self.table_file.write(‘%f\t’%current11)
self.table_file.write(‘\n’)
self.table_file.close()

#self.count = self.count+1
#self.ser.flushInput()
self.ser.close()

#event.Skip()

def OnStopButton(self, event):

self.flag = 0
self.timer1.Stop()
del
self.timer1
self.ser.close()
#event.Skip()

def OnConstantModeRadiobutton(self, event):
self.TextFile.Enable(False)
self.BrowseTextFile.Enable(False)

def OnUserModeRadiobutton(self, event):
self.TextFile.Enable(True)
self.BrowseTextFile.Enable(True)

def OnTimer1Timer(self, event):

#self.filename = “%s%s.txt”
%(os.path.normpath(self.SaveFolder.GetValue()),time.strftime(“%Y%m%d%H%M”))

self.data_hi, self.data_lo =
divmod(self.irradianceIntegers[self.counter], 0x100)

self.tx_checksum = -(self.data_hi +
self.data_lo + self.tx_command + self.tx_message_no +
self.tx_no_databyte) & 0xff
self.ser.write(pack(‘6B’, self.tx_command,
self.tx_message_no, self.tx_no_databyte, self.data_lo,
self.data_hi, self.tx_checksum))

if self.tx_len == self.counter:

self.timer1.Stop()

del self.timer1

else:

self.counter = self.counter +1

return
#event.Skip()


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com



To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org


To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org__


Do you Yahoo!?

Yahoo! Small Business - Try our new resources site!

Hi Jan,

jan rienyer gadil wrote:

sir Werner,

Werner is more then enough, don't think that the Queen will ever knight me!

I don't think i can do that. Instead may i ask you some question regarding the program:
1. on the
    def OnStartButton(self, event):

    would there be conflict between the
    self.timer1.Start(5000) and the while() loop?
    will the timer event still be executed even if the program is inside the while loop

I don't know. But the way I read Robin's response
"Receive will still be executed. The timer.Start function does not block execution, it just tells the system when to send the timer event."

I would say yes.

2. a flag is set when i click the stop and start button. will the flag still be set to 1 when i click the stop button even if the code is currently executing the while loop??

Yeap, it will be 1 until you change it.

3. would transferring this "self.filename = "%s\%s.txt" %(os.path.normpath(self.SaveFolder.GetValue()),time.strftime("%Y%m%d%H%M"))
    to the timer event, create a new file timer event???

Don't understand.
The system will fire the timer event and you should then code whatever you need in there. I would hesitate to start a new timer within there, isn't the StartButton responsible for that?

I doubt that you can use the Boa debugger to debug this type of application (serial comm might not like this), so you might want to look into dbg.py in wxPython/tools.

See you
Werner

···

thanks in advance...
  
*/"Werner F. Bruhin" <werner.bruhin@free.fr>/* wrote:

    Hi Jan,

    The attached files are not self contained, i.e. at least serial.py
    and
    Dialog1 are missing. Can you change the app so it uses some file
    objects instead of serial? If not can it be run with having nothing
    connected to the serial port? If either are possible I am willing to
    have a look at it, but don't get your hopes up I still might not
    be able
    to help as serial comms and tread stuff is not that easy (at least
    for me).

    One suggestion move the following four lines:

    self.ser = serial.Serial()
    self.ser.baudrate = 9600
    self.ser.port = 0
    self.ser.timeout = 1

    to either just before or even better after:
    self._init_ctrls(parent)

    This way you don't get errors when trying to use the Boa Designer
    (i.e.
    you will not have to re-enter this code all the time.

    See you
    Werner

    jan rienyer gadil wrote:

    >what could be the problem here? please help me in
    >debugging the program. attached is the program code.
    >
    >i think the problem lies here, since when i added this
    >part, when i click the start button, the program hangs
    >and does not respond, but still creates the text files
    >created by clicking the start button.
    >
    >the program is a GUI that controls an external
    >hardware. i am using BOA 0.3.1 w/ wxPython 2.4.2.4.
    >
    >please help!!!
    >
    > def OnStartButton(self, event):
    >
    > self.flag = 1
    >
    > output_file =
    >open(os.path.join(self.SaveFolder.GetValue(),'info.txt'),
    >'w')
    > output_file.write('Date:\t\t\t')
    > output_file.write(self.maskedDate.GetValue())
    > output_file.write('\nPV Type:\t\t')
    >
    >output_file.write(self.maskedPVType.GetValue())
    > output_file.write('\nNominal Peak Power:\t')
    >
    >output_file.write(self.maskedNomPeakPow.GetValue())
    > output_file.write('\nMinimum Power:\t\t')
    >
    >output_file.write(self.maskedMinPow.GetValue())
    > output_file.write('\nPeak Power Voltage:\t')
    >
    >output_file.write(self.maskedPeakPowVolt.GetValue())
    > output_file.write('\nPeak Power Current:\t')
    >
    >output_file.write(self.maskedPeakPowCurr.GetValue())
    > output_file.write('\nOpen Circuit Voltage:\t')
    >
    >output_file.write(self.maskedOpenCircVolt.GetValue())
    > output_file.write('\nShort Circuit
    >Current:\t')
    >
    >output_file.write(self.maskedShortCircCurr.GetValue())
    > output_file.write('\nUser:\t\t\t')
    > output_file.write(self.maskedUser.GetValue())
    > output_file.close()
    >
    > self.ser.open()
    > self.tx_command = 67
    > self.tx_no_databyte = 2
    > self.tx_message_no = 1
    > self.tx_len = len (self.irradianceIntegers)
    >
    > self.counter = 0
    > self.timer1.Start(5000)
    >
    > self.count = 0
    > self.temp1 =
    > self.temp2 =
    > self.pyra1 =
    > self.pyra2 =
    > self.voltage =
    > self.current =
    >
    > while(self.flag==1 or
    >self.count<=self.tx_len):
    >
    > rx_data = self.ser.read(19)
    > rx_len = len(rx_data)
    > byte = [ord(x) for x in rx_data]
    >
    > if rx_len < 10:
    > sys.exit(1)
    >
    > for k in range (rx_len-9):
    > if byte[k] == 70 and byte [k+2] == 6
    >and sum(byte[k:k+10]) & 0xff == 0:
    >
    > temp11 = float(byte[k+3])* 5/255
    > temp22 = float(byte[k+4])* 5/255
    > pyra11 = float(byte[k+5])* 5/255
    > pyra22 = float(byte[k+6])* 5/255
    > voltage11 = float(byte[k+7])*
    >5/255
    > current11 = float(byte[k+8])*
    >5/255
    >
    > self.temp1.append(temp11)
    > self.temp2.append(temp22)
    > self.pyra1.append(pyra11)
    > self.pyra2.append(pyra22)
    > self.voltage.append(voltage11)
    > self.current.append(current11)
    >
    > self.filename = "%s\%s.txt"
    >%(os.path.normpath(self.SaveFolder.GetValue()),time.strftime("%Y%m%d%H%M"))
    > self.table_file =
    >open(self.filename,"a")
    >
    >self.table_file.write('%f\t'%temp11)
    >
    >self.table_file.write('%f\t'%temp22)
    >
    >self.table_file.write('%f\t'%pyra11)
    >
    >self.table_file.write('%f\t'%pyra22)
    >
    >self.table_file.write('%f\t'%voltage11)
    >
    >self.table_file.write('%f\t'%current11)
    > self.table_file.write('\n')
    > self.table_file.close()
    >
    > #self.count = self.count+1
    > #self.ser.flushInput()
    > self.ser.close()
    >
    > #event.Skip()
    >
    > def OnStopButton(self, event):
    >
    > self.flag = 0
    > self.timer1.Stop()
    > del self.timer1
    > self.ser.close()
    > #event.Skip()
    >
    > def OnConstantModeRadiobutton(self, event):
    > self.TextFile.Enable(False)
    > self.BrowseTextFile.Enable(False)
    >
    > def OnUserModeRadiobutton(self, event):
    > self.TextFile.Enable(True)
    > self.BrowseTextFile.Enable(True)
    >
    > def OnTimer1Timer(self, event):
    >
    > #self.filename = "%s\%s.txt"
    >%(os.path.normpath(self.SaveFolder.GetValue()),time.strftime("%Y%m%d%H%M"))
    >
    > self.data_hi, self.data_lo =
    >divmod(self.irradianceIntegers[self.counter], 0x100)
    >
    > self.tx_checksum = -(self.data_hi +
    >self.data_lo + self.tx_command + self.tx_message_no +
    >self.tx_no_databyte) & 0xff
    > self.ser.write(pack('6B', self.tx_command,
    >self.tx_message_no, self.tx_no_databyte, self.data_lo,
    >self.data_hi, self.tx_checksum))
    >
    ># if self.tx_len == self.counter:
    ># self.timer1.Stop()
    ># del self.timer1
    ># else:
    > self.counter = self.counter +1
    >
    > return
    > #event.Skip()
    >
    >__________________________________________________
    >Do You Yahoo!?
    >Tired of spam? Yahoo! Mail has the best spam protection around
    >http://mail.yahoo.com
    >
    >------------------------------------------------------------------------
    >
    >---------------------------------------------------------------------
    >To unsubscribe, e-mail:
    wxPython-users-unsubscribe@lists.wxwidgets.org
    >For additional commands, e-mail:
    wxPython-users-help@lists.wxwidgets.org
    >

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
    For additional commands, e-mail:
    wxPython-users-help@lists.wxwidgets.org

------------------------------------------------------------------------
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site! <http://us.rd.yahoo.com/evt=31637/*http://smallbusiness.yahoo.com/resources/&gt;

ooopppss, sorry about this:

3. would transferring this "self.filename =

"%s\%s.txt"
>

%(os.path.normpath(self.SaveFolder.GetValue()),time.strftime("%Y%m%d%H%M"))

> to the timer event, create a new file timer
event???
>

Don't understand.
The system will fire the timer event and you should
then code whatever
you need in there. I would hesitate to start a new
timer within there,
isn't the StartButton responsible for that?

it should have been:
would transferring this "..." to the timer event,
create a new text file everytime the timer event
executes???

···

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around

jan rienyer gadil wrote:

what could be the problem here? please help me in
debugging the program. attached is the program code.

i think the problem lies here, since when i added this
part, when i click the start button, the program hangs
and does not respond, but still creates the text files
created by clicking the start button.

How long is the while loop expected to run? If it takes longer than a second or so then the app will definitly appear to be unresponsive because you are not allowing the program flow to return to the main event loop, and so the app is not able to process any events. If that is the case then you'll probably want to move the time-consuming code to an alternate thread. Some other options are here:

http://wiki.wxpython.org/index.cgi/LongRunningTasks

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!