No subject

James Matthews nytrokiss at gmail.com
Wed Dec 12 15:36:32 EST 2007


you can also use a for loop =)

list = [1,2,3,4,5,6,7]
str = ' '
for i in list:
   str+=i
print str



On Dec 12, 2007 2:25 PM, Lee Capps <lcapps at cteresource.org> wrote:

>
> On Dec 11, 2007, at 5:14 PM, katie smith wrote:
>
> > "[16, 16, 2, 16, 2, 16, 8, 16]"
>
> Regular expressions might be a good way to handle this.
>
> import re
>
> s = '[16, 16, 2, 16, 2, 16, 8, 16]'
> get_numbers = re.compile('\d\d*').findall
>
> numbers = [int(x) for x in get_numbers(s)]
>
> See:
>
> http://docs.python.org/lib/module-re.html
>
> ---
> Lee Capps
> Technology Specialist
> CTE Resource Center
> lcapps at cteresource.org
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
http://search.goldwatches.com/?Search=Movado+Watches
http://www.jewelerslounge.com
http://www.goldwatches.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071212/20b7eeb2/attachment.html>


More information about the Python-list mailing list