How to Split a String

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Fri Nov 30 02:59:03 EST 2007


On Thu, 29 Nov 2007 12:12:20 -0800, Siah wrote:

> I need to convert the string: '(a, b, "c", d, "e")' into the following
> list ['a', 'b', 'c', 'd', 'e']. Much like a csv reader does. I usually
> use the split function, but this mini-monster wouldn't properly get
> split up due to those random quotations postgresql returns to me.

I hope you don't use Python to access the database, get a tuple back,
convert it to a string and then try to break up that string into a list!?

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list