python parsing question from a python newbie (though coding for 10 years)

Bjorn Pettersen BPettersen at NAREX.com
Mon Feb 3 15:15:15 EST 2003


> From: Pat McGroin [mailto:a5h1th34d at hotmail.com] 
> 
> I need to take a string and parse\split\breakup the string into each
> seperate character into an array.  The only part I don't know is how
> to split into seperate chars, could someone please give me a quick 1
> line of code answer?

Python doesn't have a character type (i.e. 'a' is a string of length
one). For all practical purposes however, once you have a string you can
treat it as an array of characters ('hello'[2] == 'l'). Does this help?

-- bjorn





More information about the Python-list mailing list