string.join question

Chris Myers chris.myers at prov.ingenta.com
Thu Oct 3 10:50:14 EDT 2002


Mongo:

Looks like you have a copy-paste error in your testing of the previous
poster's reply:

He said to do:
a = string.join(string.join(["'", value,"'"],''),'')
                                                  ^
                                              '' not ','

However, you should probably upgrade your python, since that format
has been deprecated, and join is now a method of string objects, not
the string module.
As such, the new way to do this is:

a = ''.join(["'", "aaa", "'"])

I know this suggestion came before, but it got a little garbled from
my POV.

Good luck,


mongo57a at comcast.net wrote in message news:<3d9b9906$1_2 at goliath.newsgroups.com>...
> Thanks - it "kind of" works - but not quite. So now there is a part 2 of the
> question:
> 
> value = 'aaa'
> a = string.join(string.join(["'", value,"'"],''),',')
> 
> This should yield (what I want.....): 'aaa',
> 
> Instead it yields: ',a,a,a,'
> 
> ??????????????????????? Looks crazy to me......
> 
> 
> -----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
>    http://www.newsfeed.com       The #1 Newsgroup Service in the World!
> -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----



More information about the Python-list mailing list