how to append semicolon to a variable
grante at visi.com
Sat Aug 13 19:02:47 CEST 2005
On 2005-08-13, yaffa <yxxxxlxxxxx at gmail.com> wrote:
> i have the following lines of python code:
> couch = incident.findNextSibling('td')
> price = couch.findNextSibling('td')
> sdate = price.findNextSibling('td')
> city = sdate.findNextSibling('td')
> strUrl = addr.b.string
> currently what this ends up doing is creating something like this
> now what i want to do is add a semicolon after the couch, price, sdate,
> city so that i get something like this
> couch;32;01/01/2004;new york
s = ';'.join([couch,price,sdate,city])
> p.s. i tried couch = couch + ';'
> and then i tried couch = couch + ";"
both of those should have worked fine.
> and then i tried couch = couch.append ';'
1) The append() method of a sequence doesn't return anything.
2) You call methods using ()
3) String are immutable, and therefore don't have an append
Perhaps you ought to read through the tutorial?
Grant Edwards grante Yow! LOOK!!! I'm WALKING
at in my SLEEP again!!
More information about the Python-list