May I drop list bracket from list?
ben.lists at bsb.me.uk
Thu Apr 23 13:21:53 CEST 2015
subhabrata.banerji at gmail.com writes:
> I am trying to read a list of files as
> list_of_files = glob.glob('C:\Python27\*.*')
> Now I am trying to read each one of them,
> convert into list of words, and append to a list
> for file in list_of_files:
> print file
> Here the list is a list of lists, but I want only one list not
> list of lists.
You probably want list.extend(fword) here. Python's ternimology is a
little quirky here -- in some other languages (ntable the mother of all
list langiages, Lisp), the append function does what Python's extend
More information about the Python-list