Opposite of split

Gary Herron gherron at islandtraining.com
Sun Aug 15 14:35:15 EDT 2010


On 08/15/2010 11:24 AM, Alex van der Spek wrote:
> Looking for a method that does the opposite of 'split', i.e. elements 
> in a list are automatically concatenated with a user selectable spacer 
> in between e.g. '\t'. This is to prepare lines to be written to a 
> sequential file by 'write'.
>
> All hints welcome.
>
> Regards,
> Alex van der Spek

Strings have a join method for this:
     '\t'.join(someList)

Gary Herron



More information about the Python-list mailing list