Re: Pyserial again

2006-03-08 Thread Grant Edwards
On 2006-03-08, luca72 [EMAIL PROTECTED] wrote: Belive me for a person of my age and my background ( i'm a physics, but at my time no computer was allowed) all that for you is simple, Believe me, it wasn't simple for us. We had to guess what you were doing wrong since you wouldn't show us

Re: Pyserial again

2006-03-07 Thread luca72
Here is my code ; why after the readline the port close? ser = serial.Serial(0) ser.baudrate = 9600 ser.parity = serial.PARITY_ODD ser.stopbits = serial.STOPBITS_TWO ser.bytesize =serial.EIGHTBITS ser.setRTS(level = 0) ser.setDTR(level = 0)

Re: Pyserial again

2006-03-07 Thread Peter Hansen
luca72 wrote: Here is my code ; why after the readline the port close? What is the line of code before the first one shown here? ser = serial.Serial(0) ser.baudrate = 9600 ser.parity = serial.PARITY_ODD ser.stopbits = serial.STOPBITS_TWO

Re: Pyserial again

2006-03-07 Thread luca72
def OnButton1Button(self, event): ser = serial.Serial(0) ser.baudrate = 9600 ser.parity = serial.PARITY_ODD ser.stopbits = serial.STOPBITS_TWO ser.bytesize =serial.EIGHTBITS ser.setRTS(level = 0) ser.setDTR(level = 0)

Re: Pyserial again

2006-03-07 Thread Grant Edwards
On 2006-03-07, luca72 [EMAIL PROTECTED] wrote: Here is my code; why after the readline the port close? ser = serial.Serial(0) ser.baudrate = 9600 ser.parity = serial.PARITY_ODD ser.stopbits = serial.STOPBITS_TWO ser.bytesize =serial.EIGHTBITS

Re: Pyserial again

2006-03-07 Thread Steve Holden
Grant Edwards wrote: On 2006-03-07, luca72 [EMAIL PROTECTED] wrote: Here is my code; why after the readline the port close? ser = serial.Serial(0) ser.baudrate = 9600 ser.parity = serial.PARITY_ODD ser.stopbits = serial.STOPBITS_TWO ser.bytesize

Re: Pyserial again

2006-03-07 Thread Grant Edwards
On 2006-03-07, Steve Holden [EMAIL PROTECTED] wrote: Here is my code; why after the readline the port close? ser = serial.Serial(0) ser.baudrate = 9600 ser.parity = serial.PARITY_ODD ser.stopbits = serial.STOPBITS_TWO ser.bytesize =serial.EIGHTBITS

Re: Pyserial again

2006-03-07 Thread luca72
Hello Grant and Hello Steve. Pls. don't kill me, but if you try the code above written you see that after the read the port close. My question is only: why it close without the close command? -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyserial again

2006-03-07 Thread Petr Jakes
1) Peter Hansen was asking you for the code AFTER the ser.readline() not BEFORE!! the code you have originally posted here 2) the best way how to examine if your code works is to try to write some simplest code as possible first (not buttons, not GUI etc..., just a simple code) (all this

Re: Pyserial again

2006-03-07 Thread luca72
Ok you write that it close :Because the ser object is never used after that point, so it get's garbage collected and deleted. But for example if i make one button with the same caracteristic of the previous com port: def OnButton1Button(self, event): ser = serial.Serial(0)

Re: Pyserial again

2006-03-07 Thread luca72
Peter Hansen was asking you for the code AFTER the ser.readline() not BEFORE!! the code you have originally posted here OK IS MY MISTAKE; EXCUSE. I have read the example but if i ask is bucause i don't or maybe i don't understand the example Regaards Luca --

Re: Pyserial again

2006-03-07 Thread Grant Edwards
On 2006-03-07, luca72 [EMAIL PROTECTED] wrote: Hello Grant and Hello Steve. Pls. don't kill me, but if you try the code above written you see that after the read the port close. My question is only: why it close without the close command? I've answered that question TWICE. The ser object is

Re: Pyserial again

2006-03-07 Thread Richie Hindle
[luca] Here is my code; why after the readline the port close? ser = serial.Serial(0) [...] ser.readline() Why after this the port close. [Grant] Because the ser object is never used after that point, so it get's garbage collected and deleted. [Steve]

Re: Pyserial again

2006-03-07 Thread Grant Edwards
On 2006-03-07, luca72 [EMAIL PROTECTED] wrote: Ok you write that it close :Because the ser object is never used after that point, so it get's garbage collected and deleted. Yes. But for example if i make one button with the same caracteristic of the previous com port: def

Re: Pyserial again

2006-03-07 Thread Peter Hansen
Richie Hindle wrote: A piece of that code has been chopped off by someone's newsreader - it's the body of a method, and ser.readline() is the last line of that method. I'm pretty sure that's true. Technically, however, it's still a guess, though at this point one I'm sure we're all

Re: Pyserial again

2006-03-07 Thread Grant Edwards
On 2006-03-07, Peter Hansen [EMAIL PROTECTED] wrote: Serial ports aren't trivial, and combining them with a GUI program written by a rookie is a pretty big order. You can learn enough to figure this out, but it will be lots of work and a challenge. If you're up to it, please go read that

Re: Pyserial again

2006-03-07 Thread luca72
Dear All Thanks for your help, and patience. Now all works in the right mode. Belive me for a person of my age and my background ( i'm a physics, but at my time no computer was allowed) all that for you is simple, is not for me. So many Thanks and Regards Luca --

Pyserial again

2006-03-06 Thread luca72
Hello I have solve the problem of configuration with pyserial but i have another question. The serial port close every time i make the read and re-open when i do i new write. In my script there is not write close , why it close ? Thaks Luca --

Re: Pyserial again

2006-03-06 Thread Grant Edwards
On 2006-03-06, luca72 [EMAIL PROTECTED] wrote: I have solve the problem of configuration with pyserial but i have another question. The serial port close every time i make the read and re-open when i do i new write. I doubt it. In my script there is not write close, why it close ? How on

Re: Pyserial again

2006-03-06 Thread Peter Hansen
luca72 wrote: I have solve the problem of configuration with pyserial but i have another question. The serial port close every time i make the read and re-open when i do i new write. Please describe what you are observing that makes you say that the port is closing. In my script there is

Re: Pyserial again

2006-03-06 Thread luca72
Hello here is a part of code, the values for settings comes from combo box: here i take the ATR of the smartcard inserted in the reader, and than i store the read data in a textctrl. Sniffing the data with serial port monitor i see that the answer is ok but after the answer the port close, why?

Re: Pyserial again

2006-03-06 Thread Grant Edwards
On 2006-03-06, luca72 [EMAIL PROTECTED] wrote: Hello here is a part of code, No. Wrong. The part of code you posted tells us nothing. We can not help you if you keep posting vague descriptions of what you imagine is wrong and small, out-of-context chunks of irrelevant code.

Re: Pyserial again

2006-03-06 Thread Luca
and than i store the read data in a textctrl. That's got nothing to do with pyserial. Ok i know but for this reason i put : Another point is the textctrl: it store only the first byte and not the other why?, the byte are like 22 and all are readed

Re: Pyserial again

2006-03-06 Thread Steve Holden
Luca wrote: and than i store the read data in a textctrl. That's got nothing to do with pyserial. Ok i know but for this reason i put : Another point is the textctrl: it store only the first byte and not the other why?, the byte are like 22 and all are readed

Re: Pyserial again

2006-03-06 Thread Grant Edwards
On 2006-03-06, Luca [EMAIL PROTECTED] wrote: Another point is the textctrl: it store only the first byte and not the other why?, the byte are like 22 and all are readed No clue. I don't know what textctrl is or what it's supposed to do. a = ser.readline() a =

Re: Pyserial again

2006-03-06 Thread Petr Jakes
Grant and Steve, I am wowed and amazed how supportive and helpful you (and other people in this group as well of course) are. Thanks. (sorry for OT) Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list