what does := means simply?

Alexandre Brault abrault at mapgears.com
Fri May 18 15:15:58 EDT 2018


On 2018-05-18 02:48 PM, bartc wrote:
> On 18/05/2018 18:27, bartc wrote:
>
>> (BTW here's a port of that benchmark based on the Lua code:
>>
>>    https://pastebin.com/raw/ivDaKudX
>
> And here's the payoff: I was able to use this version to port it to
> Python. One which works better the the originals, as they wrote output
> to the screen (/binary/ output) which I found difficult to capture
> into an actual ppm file in order to test it worked.
>
> 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.
>
> Note this version doesn't use any imports at all.
Except your version doesn't read its parameter from the command line
args and doesn't output to standard output, which all of the others do.
That's why the other Python versions of that code imported sys: Because
that's how you read from commandline args and write bytes to standard
output in Python. You don't need to know *exactly* how sys works to have
an idea of what sys.argv and sys.stdout do



More information about the Python-list mailing list