I'm wrong or Will we fix the ducks limp?

Sayth Renshaw flebber.crue at gmail.com
Fri Jun 3 19:06:55 EDT 2016


On Saturday, 4 June 2016 02:04:43 UTC+10, Michael Selik  wrote:

> 
> > That totally makes sense I was just double checking, had hoped I could
> > create a variable assign it to a list and append in one stroke.
> >
> 
> In fact you can! It's called a "list comprehension"
> 
>     pyqFiles = [pq(my_dir + filename) for filename in sorted(file_list)]

Actually thats where I was coming from I can create a list with a list comprehension in one go, but I cant create a list with an append method pf.append(thing) in one go .

Sayth


More information about the Python-list mailing list