May I drop list bracket from list?

subhabrata.banerji at subhabrata.banerji at
Thu Apr 23 12:11:56 CEST 2015

Dear Group, 

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.

I was thinking of stripping it as, str(list1).strip('[]')

but in that case it would be converted to string.

Is there a way to do it. I am using Python27 on Windows7 Professional.
Apology for an indentation error. 

If anybody may please suggest. 

Subhabrata Banerjee. 



More information about the Python-list mailing list