running a program on many processors

2010-03-07 Thread Paweł Banyś
Hello,

I have already read about Python and multiprocessing which allows using
many processors. The idea is to split a program into separate tasks and
run each of them on a separate processor. However I want to run a Python
program doing a single simple task on many processors so that their
cumulative power is available to the program as if there was one huge
CPU instead of many separate ones. Is it possible? How can it be achieved?

Best regards,

Paweł
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: a problem with writing a generator

2010-01-15 Thread Paweł Banyś
I would like to thank you for help. With the advice you provided I
managed to complete my program and now it is working as it should.

Regards,

Paweł

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: a problem with writing a generator

2010-01-14 Thread Paweł Banyś
> Assuming that include directives are like
> 
>   #include "blahblah"

Yes, I have already tried the methods related to source code processing
using Python generators but unfortunately I am dealing with BIND and its
named.conf files.

Regards,

Paweł
-- 
http://mail.python.org/mailman/listinfo/python-list


a problem with writing a generator

2010-01-14 Thread Paweł Banyś
Hello,

Please forgive me if I repeat the subject anyhow. I am trying to write a
simple program in Python which scans a config file in search for
"include" lines. If those lines are found, the files included there are
followed and scanned and if any further "include" lines are found, the
whole procedure repeats itself. The program ends when the whole tree
structure of those "includes" is generated.

I seem to have some blackout in my mind because I cannot understand how
to use a generator functionality to complete the task. If anybody has
already done such thing I would be very grateful for any guidance.

Regards,

Paweł
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-07 Thread Paweł Sakowski
Tom Anderson wrote:
> def flatten(ll):
>  return reduce(lambda a, l: a.extend(l), ll, [])
> 
> How would one do that as a list comp, by the way? I'm really not very good
> with them yet.

Not really a list-comprehension based solution, but I think what you want is

>>> ll=[[1,2],[3,4,5],[6]]
>>> sum(ll,[])
[1, 2, 3, 4, 5, 6]

-- 
 Paweł Sakowski <[EMAIL PROTECTED]>
-- 
http://mail.python.org/mailman/listinfo/python-list