what does := means simply?

bartc bc at freeuk.com
Fri May 18 17:12:47 EDT 2018


On 18/05/2018 20:15, Alexandre Brault wrote:
> On 2018-05-18 02:48 PM, bartc wrote:

>> 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

My version wasn't an entry in the Shoot-out game.

The command line input was left out as, if someone wants to port the 
algorithm to their language, they will know how it's done. (And each one 
will do that messy bit of input a little differently.)

Capturing the output as I said was problematic, and I needed that in 
order to display the .ppm output so that I could see it. Maybe in a 
Linux environment it can be piped into a program to do that. But that's 
not what I used; I needed an actual .ppm file.

(Something went wrong with the header when trying to direct it to a 
file. But directing binary data to a text display, with arbitrary byte 
sequences might be some escape code that does undesirable things, is a 
no-no for me.)

-- 
bart



More information about the Python-list mailing list