please help...writing set to a file

Alan G Isaac alan.isaac at gmail.com
Thu Jun 18 15:22:56 CEST 2009


On 6/18/2009 5:24 AM yadin apparently wrote:
> I got this python program that returns me a set like this..
> Set ([‘A\n’, B\n’, ‘C\n’, ‘D\n’, ‘E\n’, ‘F\n’, ‘G\n’ ])
> And a list pp = [‘100\n’ ‘200\n’ ‘300\n’ ‘400\n’]
> I was reading this from a file….
> How can I transform this to something that looks like this
> Column1 Column 2
> 
>   100              A
>    200             B
>    300             C
>     400            D
> 	     E
> 	     F
>                      G
> And then write this to a file???


http://docs.python.org/library/functions.html#sorted

http://docs.python.org/library/itertools.html#itertools.izip_longest

http://docs.python.org/library/stdtypes.html#str.format

http://docs.python.org/library/functions.html#open

hth,
Alan Isaac



More information about the Python-list mailing list