please help...writing set to a file

Benjamin Kaplan benjamin.kaplan at case.edu
Thu Jun 18 12:30:18 CEST 2009


On Thu, Jun 18, 2009 at 5:24 AM, yadin <conra2004 at yahoo.com> wrote:

> Good day every one!
>
> 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???
> thank you for taking your time!!!
>

I don't think you can. A set doesn't maintain order so you couldn't count on
it being returned in a particular order.


>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090618/79844012/attachment.html>


More information about the Python-list mailing list