1

I've a lists containing .las Files of different length. I couldn't figure out how it is possible to create a variable containing all the list entries separated by a ";" ?

Thanks for your help,

Mauro

Skurmedel
  • 21,515
  • 5
  • 53
  • 66
  • 4
    possible duplicate of [How to join list of strings?](http://stackoverflow.com/questions/2426988/how-to-join-list-of-strings) – Skurmedel Jan 24 '11 at 12:41

1 Answers1

3

Well am not sure if I get you but:

some_list = ['file.las', 'another_file.las', 'something.las']
e = ';'.join(some_list)
MeanEYE
  • 967
  • 8
  • 24
  • Thanks this helped out. Would you also know how to add a path before every list entry? Something like: Add: path2+"\\" to every list entry resulting in a "new list" on which I can do the ';'.join(some_list). Thanks – Mauro Marty Jan 24 '11 at 14:16
  • ';'.join(map(lambda list_entry:path2+'\'+list_entry,list)) – Frost.baka Jan 24 '11 at 15:04
  • As @Frost.baka explained but I'd also add os.path.join(path2, list_entry). That way you don't have to think on which OS you are. – MeanEYE Jan 28 '11 at 12:10