what does := means simply?

Chris Angelico rosuav at gmail.com
Fri May 18 14:57:41 EDT 2018


On Sat, May 19, 2018 at 4:48 AM, bartc <bc at freeuk.com> wrote:
> The translation was straightforward, EXCEPT that I wasted an hour trying to
> figure out to write /a single byte/ to a file. The following eventually
> worked, using a binary file as a text one had Unicode problems, but it's
> still hacky.

You can't write a single byte to a text file, because text files don't
store bytes. I'm not sure which part of this took you an hour to
figure out.

> # For Python 3 (it'll work on Python 2 but give the wrong results)

What does "work" mean? If it gives the wrong results, how is it working?

> end = 0                # lines containing 'end' can be removed

You're not writing Python code here.

ChrisA



More information about the Python-list mailing list