[Beds] python question

Lee Larcombe lee at larcombe.uk-internet.org.uk
Tue Mar 22 20:04:53 GMT 2005


Hi

I am trying to learn python, and i have hit a problem I can't find a 
solution for.

I want to split a string into a list - ie

string = 'abcde'

would become

list = ['a', 'b', 'c', 'd', 'e']

I can do this in perl by using:

@array= unpack("A1" x length($string), $string);

Can anyone tell me a python way of doing this???

I know python could use string.split(";") to split a string on a 
delimiter (; in this case) but there doesn't seem a way to use split 
without a delimiting character

I can't believe this is impossible - please help!!!

Lee.




More information about the Beds mailing list