Blocking readline() Call?
Paul Clinch
pclinch at internet-glue.co.uk
Mon Nov 10 17:47:28 EST 2003
"Scott Brady Drummonds" <scott.b.drummonds.nospam at intel.com> wrote in message news:<booqnf$ioc$1 at news01.intel.com>...
> Hi, everyone,
>
> I'm just figuring Python out but have become stalled with the following
> snippit of code: For some reason, the program stalls after the "read line:
> x" for the last line. The 'done reading cycle map' message is never
> generated:
>
> while 1:
> line = file.readline()
> if line == '':
> continue
Perhaps you meant break.
> data = line.strip().split(':')
> cycleMap[int(data[0])] = int(data[1])
> i = i + 1
> print ('read line %d' % i)
> file.close()
> print ('done reading cycle map')
>
> I thought readline() was supposed to be non-blocking. Have I misunderstood
> something?
>
> Thanks,
> Scott
Regards, Paul Clinch
More information about the Python-list
mailing list