removing duplicates, or, converting Set() to string

2006-07-26 Thread maphew
Hello,

I have some lists for which I need to remove duplicates. I found the
sets.Sets() module which does exactly this, but how do I get the set
back out again?

# existing input: A,B,B,C,D
# desired result: A,B,C,D

import sets
dupes = ['A','B','B','C','D']
clean = sets.Set(dupes)

out = open('clean-list.txt','w')
out.write(clean)
out.close

---
out.write(clean) fails with "TypeError: argument 1 must be string or
read-only character buffer, not Set" and out.write( str(clean) )
creates "Set(['A', 'C', 'B', 'D'])" instead of just A,B,C,D.

thanks in advance for your time,

-matt

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: removing duplicates, or, converting Set() to string

2006-07-27 Thread maphew
thank you everybody for your help!  That worked perfectly. :) I really
appreciate the time you spent answering what is probably a pretty basic
question for you. It's nice not to be ignored.

be well,

-matt

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: install py2exe in vista

2008-07-04 Thread maphew
SOLVED: right-click on the install program and "Run as administrator"

solution courtesy of 
http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=34538

On Jun 22, 11:34 am, jim-on-linux <[EMAIL PROTECTED]> wrote:
> On Saturday 21 June 2008 13:28, Herman wrote:
>
> >  I want to install it in
> > vista >l#>, but i get this message in the process:
> >couldnotcreate...py2exe-py2.5
>
> I forwarded your question but you may want to ask again
> at the link below.
>
> [EMAIL PROTECTED]
>
> jim-on-linuxhttp://inqvista.com
>
>
>
> > I press 'OK', then..
> >couldnotset key value python 2.5 py2exe-0.6.8
>
> > I press 'OK' again, then...
> >couldnotset key value
> > c:\Python25\Removepy2exe.exe" -u
> > "c:\python25\py2exe-wininst.log
>
> > The installation goes on and do something, run some
> > postinstall script.
>
> > I thought it should be ok, but i fail even creating
> > a simple hello word exe. I get this message after i
> > run python setup.py install: running install
> > running build
> > running install_egg_info
> > Writing
> > c:\Python25\Lib\site-packages\UNKNOWN-0.0.0-py2.5-eg
> >g-info
>
> > No output is created.
>
> > Can I anyone help me with this?
> > 
> >  >ost&p=631985>- Hide quoted text -
>
> - Show quoted text -

--
http://mail.python.org/mailman/listinfo/python-list