Re: with open('com1', 'r') as f:

2009-04-07 Thread Terry Reedy
Lawrence D'Oliveiro wrote: In message mailman.3438.1239062418.11746.python-l...@python.org, Delaney, Timothy (Tim) wrote: Lawrence D'Oliveiro wrote: In message mailman.3332.1238914117.11746.python-l...@python.org, Terry Reedy wrote: Lawrence D'Oliveiro wrote: All Python objects are

RE: with open('com1', 'r') as f:

2009-04-06 Thread Delaney, Timothy (Tim)
Lawrence D'Oliveiro wrote: In message mailman.3332.1238914117.11746.python-l...@python.org, Terry Reedy wrote: Lawrence D'Oliveiro wrote: All Python objects are reference-counted. Nope. Only in CPython, and even that could change. Why should it? Because Guido has said it might

RE: with open('com1', 'r') as f:

2009-04-06 Thread Lawrence D'Oliveiro
In message mailman.3438.1239062418.11746.python-l...@python.org, Delaney, Timothy (Tim) wrote: Lawrence D'Oliveiro wrote: In message mailman.3332.1238914117.11746.python-l...@python.org, Terry Reedy wrote: Lawrence D'Oliveiro wrote: All Python objects are reference-counted. Nope.

Re: with open('com1', 'r') as f:

2009-04-05 Thread Steven D'Aprano
On Sun, 05 Apr 2009 15:51:31 +1200, Lawrence D'Oliveiro wrote: All Python objects are reference-counted. Once the file object becomes inaccessible, it is automatically closed. Simple. If only it were so simple. Firstly, what you describe is an implementation detail of CPython, not Python the

Re: with open('com1', 'r') as f:

2009-04-05 Thread Terry Reedy
: with open('com1', 'r') as f: for line in f: print('line') Why bother, why not just for line in open('com1', 'r') : print line So its does the same thing as with right ? Why do you need a with? Automatic closing and finalizing stuff. All Python objects are reference-counted. Nope

Re: with open('com1', 'r') as f:

2009-04-05 Thread Lawrence D'Oliveiro
In message 01e842d6$0$20654$c3e8...@news.astraweb.com, Steven D'Aprano wrote: Firstly, what you describe is an implementation detail of CPython, not Python the language. Jython does not close files as soon as they become inaccessible, and IronPython and CLPython may not. That's a limitation

Re: with open('com1', 'r') as f:

2009-04-05 Thread Steven D'Aprano
On Sun, 05 Apr 2009 18:52:58 +1200, Lawrence D'Oliveiro wrote: In message 01e842d6$0$20654$c3e8...@news.astraweb.com, Steven D'Aprano wrote: Firstly, what you describe is an implementation detail of CPython, not Python the language. Jython does not close files as soon as they become

Re: with open('com1', 'r') as f:

2009-04-05 Thread gert
On Apr 5, 12:24 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Sat, 04 Apr 2009 14:11:12 -0300, gert gert.cuyk...@gmail.com escribió: On Apr 4, 5:20 pm, Kushal Kumaran kushal.kuma...@gmail.com wrote: On Fri, 03 Apr 2009 22:10:36 +0200 Christian Heimes li...@cheimes.de wrote:

Re: with open('com1', 'r') as f:

2009-04-05 Thread Lawrence D'Oliveiro
In message mailman.3332.1238914117.11746.python-l...@python.org, Terry Reedy wrote: Lawrence D'Oliveiro wrote: All Python objects are reference-counted. Nope. Only in CPython, and even that could change. Why should it? Once the file object becomes inaccessible, it is automatically

Re: with open('com1', 'r') as f:

2009-04-04 Thread gert
On Apr 4, 12:58 am, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message 8bc55c05-19da-41c4- b916-48e0a4be4...@p11g2000yqe.googlegroups.com, gert wrote:     with open('com1', 'r') as f:         for line in f:              print('line') Why bother, why not just

Re: with open('com1', 'r') as f:

2009-04-04 Thread gert
On Apr 3, 10:10 pm, Christian Heimes li...@cheimes.de wrote: gert wrote: I do understand, and I went looking into pySerial, but it is a long way from getting compatible with python3.x and involves other libs that are big and non pyhton3.x compatible. So don't use Python 3.0. Most people

Re: with open('com1', 'r') as f:

2009-04-04 Thread Kushal Kumaran
On Fri, 03 Apr 2009 22:10:36 +0200 Christian Heimes li...@cheimes.de wrote: gert wrote: I do understand, and I went looking into pySerial, but it is a long way from getting compatible with python3.x and involves other libs that are big and non pyhton3.x compatible. So don't use Python

Re: with open('com1', 'r') as f:

2009-04-04 Thread gert
On Apr 4, 5:20 pm, Kushal Kumaran kushal.kuma...@gmail.com wrote: On Fri, 03 Apr 2009 22:10:36 +0200 Christian Heimes li...@cheimes.de wrote: gert wrote: I do understand, and I went looking into pySerial, but it is a long way from getting compatible with python3.x and involves other

Re: with open('com1', 'r') as f:

2009-04-04 Thread Gabriel Genellina
En Sat, 04 Apr 2009 11:29:22 -0300, gert gert.cuyk...@gmail.com escribió: On Apr 4, 12:58 am, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message 8bc55c05-19da-41c4- b916-48e0a4be4...@p11g2000yqe.googlegroups.com, gert wrote:     with open('com1', 'r') as f

Re: with open('com1', 'r') as f:

2009-04-04 Thread Diez B. Roggisch
gert schrieb: On Apr 3, 10:10 pm, Christian Heimes li...@cheimes.de wrote: gert wrote: I do understand, and I went looking into pySerial, but it is a long way from getting compatible with python3.x and involves other libs that are big and non pyhton3.x compatible. So don't use Python 3.0.

Re: with open('com1', 'r') as f:

2009-04-04 Thread Christian Heimes
gert wrote: On Apr 3, 10:10 pm, Christian Heimes li...@cheimes.de wrote: gert wrote: I do understand, and I went looking into pySerial, but it is a long way from getting compatible with python3.x and involves other libs that are big and non pyhton3.x compatible. So don't use Python 3.0. Most

Re: with open('com1', 'r') as f:

2009-04-04 Thread Gabriel Genellina
En Sat, 04 Apr 2009 14:11:12 -0300, gert gert.cuyk...@gmail.com escribió: On Apr 4, 5:20 pm, Kushal Kumaran kushal.kuma...@gmail.com wrote: On Fri, 03 Apr 2009 22:10:36 +0200 Christian Heimes li...@cheimes.de wrote: gert wrote: I do understand, and I went looking into pySerial, but it is

Re: with open('com1', 'r') as f:

2009-04-04 Thread Lawrence D'Oliveiro
In message 91e09eaf-5a25-4a6b-b131- a5245970b...@f19g2000yqh.googlegroups.com, gert wrote: On Apr 4, 12:58 am, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message 8bc55c05-19da-41c4- b916-48e0a4be4...@p11g2000yqe.googlegroups.com, gert wrote: with open('com1', 'r

Re: with open('com1', 'r') as f:

2009-04-03 Thread Gabriel Genellina
=True) while True:     with open('com1', 'r') as f:         for line in f:              print('line') This works very well except for one thing. After a reboot I have to launch 1 time any windows serial exe application no mater with one, that just opens an closes the com port, before i can

Re: with open('com1', 'r') as f:

2009-04-03 Thread gert
subprocess import * check_call(['mode', 'COM1:9600,N,8,1,P'],shell=True) while True:     with open('com1', 'r') as f:         for line in f:              print(line) This works very well except for one thing. After a reboot I have to launch 1 time any windows serial exe

Re: with open('com1', 'r') as f:

2009-04-03 Thread Christian Heimes
gert wrote: I do understand, and I went looking into pySerial, but it is a long way from getting compatible with python3.x and involves other libs that are big and non pyhton3.x compatible. So don't use Python 3.0. Most people are still using Python 2.5 or 2.6. Christian --

Re: with open('com1', 'r') as f:

2009-04-03 Thread Lawrence D'Oliveiro
In message 8bc55c05-19da-41c4- b916-48e0a4be4...@p11g2000yqe.googlegroups.com, gert wrote: with open('com1', 'r') as f: for line in f: print('line') Why bother, why not just for line in open('com1', 'r') : print line -- http://mail.python.org/mailman

with open('com1', 'r') as f:

2009-04-02 Thread gert
from subprocess import * check_call(['mode', 'COM1:9600,N,8,1,P'],shell=True) while True: with open('com1', 'r') as f: for line in f: print('line') This works very well except for one thing. After a reboot I have to launch 1 time any windows serial exe application

Re: with open('com1', 'r') as f:

2009-04-02 Thread Kushal Kumaran
On Thu, 2 Apr 2009 10:01:02 -0700 (PDT) gert gert.cuyk...@gmail.com wrote: from subprocess import * check_call(['mode', 'COM1:9600,N,8,1,P'],shell=True) while True: with open('com1', 'r') as f: for line in f: print('line') This works very well except for one

Re: with open('com1', 'r') as f:

2009-04-02 Thread gert
On Apr 2, 8:53 pm, Kushal Kumaran kushal.kuma...@gmail.com wrote: On Thu, 2 Apr 2009 10:01:02 -0700 (PDT) gert gert.cuyk...@gmail.com wrote: from subprocess import * check_call(['mode', 'COM1:9600,N,8,1,P'],shell=True) while True:     with open('com1', 'r') as f:         for line