Matteo wrote:
> it works and I like slices, but I was wondering if there was another
> way of doing the same thing, maybe reading the numbers in groups of
> arbitrary length n...
from http://docs.python.org/library/itertools.html#recipes
def grouper(n, iterable, fillvalue=None):
"grouper(3,
In article <49e06774$0$700$5fc3...@news.tiscali.it>,
Francesco Bochicchio wrote:
>> On Sat, Apr 11, 2009 at 1:44 AM, Matteo wrote:
>>>
>>> I need to pass the numbers to a function, but three at a time, until
>>> the string ends. The strings are of variable length, but always a
>>> multiple of th
Matteo wrote:
> Hi all,
> let's see if there is a more "pythonic" way of doing what I'm trying
> to do.
> I have a lot of strings with numbers like this one:
>
> string = "-1 1.3 100.136 1 2.6 100.726 1 3.9 101.464 -1 5.2 102.105"
>
> I need to pass the numbers to a function, but three at a time
Chris Rebert ha scritto:
On Sat, Apr 11, 2009 at 1:44 AM, Matteo wrote:
Hi all,
let's see if there is a more "pythonic" way of doing what I'm trying
to do.
I have a lot of strings with numbers like this one:
string = "-1 1.3 100.136 1 2.6 100.726 1 3.9 101.464 -1 5.2 102.105"
I need to pass t
On Sat, Apr 11, 2009 at 1:44 AM, Matteo wrote:
> Hi all,
> let's see if there is a more "pythonic" way of doing what I'm trying
> to do.
> I have a lot of strings with numbers like this one:
>
> string = "-1 1.3 100.136 1 2.6 100.726 1 3.9 101.464 -1 5.2 102.105"
>
> I need to pass the numbers to
Hi all,
let's see if there is a more "pythonic" way of doing what I'm trying
to do.
I have a lot of strings with numbers like this one:
string = "-1 1.3 100.136 1 2.6 100.726 1 3.9 101.464 -1 5.2 102.105"
I need to pass the numbers to a function, but three at a time, until
the string ends. The st