SourceForge has been redesigned. Learn more.
Close

Boa and pyserial

Help
eldi
2006-09-19
2013-05-01
  • eldi

    eldi - 2006-09-19

    Hello, I'm a new user of Boa, I like it very much but I'm having problems with serial communication, I've put a little piece of code under an Onbutton def. and when I click, it seems to run twice or at least the serial output appears twice
    Same code in wxglade runs perfectly
    Ideas?

       def OnButton1Button(self, event):     
            ser=serial.Serial("com1",1200,timeout=5)
            ser.write("Hello\n")     
            datodigi=ser.readline()      
            ser.close()      
            self.textCtrl2.SetValue(datodigi)
            event.Skip()

     
    • Werner F. Bruhin

      On a button event you don't need the event.Skip(), maybe that is the problem?

      Boa put the event.Skip() when it generates the method, but you can remove it when you put your code in there.

      Werner

       
    • eldi

      eldi - 2006-09-20

      That was it, without the even.Skip() all runs OK.
      Thank you very much, for the quick responce.
      Like I said I'm new and have a lot to learn.
      Again thanks

       

Log in to post a comment.