[Tutor] Splitting
Terry Carroll
carroll at tjc.com
Mon Jul 10 09:12:20 CEST 2006
On Mon, 10 Jul 2006, John Fouhy wrote:
> On 10/07/06, Abhinav Gaurav <abhinavtester at yahoo.co.uk> wrote:
> > John Fouhy <john at fouhy.net> wrote:
> > > What version of python are you running?
> > 1.5.2 is the version.
>
> Right. Well, you're slightly over 7 years out of date :-) Do you
> have the ability to upgrade?
Abhinav, I second upgrading. There's been so much great stuff added to
Python since 1.5, it's well worth the upgrade.
If you're stuck on 1.5.2, I *think* this will do what you want (I'm
actually executing under 2.4.1, but I think this should work under 1.5 as
well):
>>> import string
>>> a="43;dsds;d"
>>> b=string.split(a,';')
>>> b
['43', 'dsds', 'd']
>>>
More information about the Tutor
mailing list