This is my first program in Python

Richard Zilavec rzilavec at tcn.net
Thu Jan 18 22:36:40 EST 2001


On Thu, 18 Jan 2001 08:21:47 -0500, "Steve Holden"
<sholden at holdenweb.com> wrote:

>Very Pythonic! The parentheses are unnecessaary in the assignment, but
>that's a nit. Also, in Python 2 you could replace string.split(line, ":", 1)
>with line.split(':', 1), and avoid the need to import the string module. But
>that's another nit. This is a good program.

I'm currently using Python 1.52, it came with the version of Linux I
installed.  My book is also based on it, so I don't think its a bad
thing for now.  The parentheses are my Perl instincts.....

>> This was my first attempt, which looks like it should work but failed:
>> invalid syntax.  Is this not possible?
>> while line = file.readlines():
>>
>The assignment has deliberately been designated a statement rather than an
>expression,

I now see why it didn't work, thank you.

Thanks

--
 Richard Zilavec
 rzilavec at tcn.net



More information about the Python-list mailing list