.Re: scanf string in python
No_spamming at noWhere_7073.org
Fri Apr 21 03:14:50 EDT 2017
> > I have a string which is returned by a C extension.
> > mystring = '(1,2,3)'
> > HOW can I read the numbers in python ?
> re.findall seems the safest and easiest solution:
> >>> re.findall(r'(\d+)', '(1, 2, 3)')
> ['1', '2', '3']
> >>> map(int, re.findall(r'(\d+)', '(1, 2, 3)'))
> [1, 2, 3]
[1, 2, 3]
[T]he attackers tore off the woman's clothes and raped her until five others
arrived.... The new arrivals took turns having sex with her and then sodomized
her.... At gunpoint, the assailants forced the mother and son to have sex.
More information about the Python-list