Trying to install module, No module named scipy_distutils.core (but i have scipy)

2008-10-16 Thread process
trying to install PyKF-0.1 (Kalman Filters) http://pykf.sourceforge.net/ I have Numpy, Scipy, Matplotlib installed an have successfully installed other packages using them. $ setup.py Traceback (most recent call last): File "./setup.py", line 2, in from scipy_distutils.core import setup

Re: Pr. Euler 18, recursion problem

2008-10-06 Thread process
On Oct 6, 8:13 am, Aidan <[EMAIL PROTECTED]> wrote: > process wrote: > > I am trying to solve project euler problem 18 with brute force(I will > > move on to a better solution after I have done that for problem 67). > >http://projecteuler.net/index.php?section=problems&

If an OS was to be written in Python, how'w it look?

2008-10-05 Thread process
If an OS was to be written in Python and the hardware optimized for it, what changes would be made to the hardware to accomodate Python strenghs and weaknesses? Some tagged architecture like in Lisp machines? http://en.wikipedia.org/wiki/Tagged_architecture What else? -- http://mail.python.org/ma

Pr. Euler 18, recursion problem

2008-10-05 Thread process
I am trying to solve project euler problem 18 with brute force(I will move on to a better solution after I have done that for problem 67). http://projecteuler.net/index.php?section=problems&id=18 However I can't get the recursive function right. I always have to use return right? Unless I am prin

Recursion, generate all pyramid-paths, not working

2008-10-04 Thread process
http://projecteuler.net/index.php?section=problems&id=18 def recur(tree, pos): if not tree: return [] else: return [[tree[0][pos]] + recur(tree[1:], pos)] + \ [[tree[0][pos]] + recur(tree[1:], pos+1)] i have a list with [[1],[2,3],[4,5,6],[7,8,9,10]] it

Inheritance but only partly?

2008-10-02 Thread process
Let's say I have a class X which has 10 methods. I want class Y to inherit 5 of them. Can I do that? Can I do something along the lines of super(Y, exclude method 3 4 7 9 10) ? -- http://mail.python.org/mailman/listinfo/python-list

Python 2.6, GUI not working on vista?

2008-10-02 Thread process
i just downloaded 2.6 and when running the gui nothing happens. anyone else with the same problem? -- http://mail.python.org/mailman/listinfo/python-list

What is not objects in Python?

2008-09-28 Thread process
I have heard some criticism about Python, that it is not fully object- oriented. What is not an object in Python? Why isn't len implemented as a str.len and list.len method instead of a len(list) function? -- http://mail.python.org/mailman/listinfo/python-list

what does ` ` do in ' '.join([`x * x` for x in range(1, 6)])?

2008-09-26 Thread process
' '.join([`x * x` for x in range(1, 6)]) exactly what does this symbol do and what does it stand for? -- http://mail.python.org/mailman/listinfo/python-list

Pyflix, confused about super() call

2008-09-23 Thread process
Anyone using Pyflix for the Netflix prize. How can it call super to itself in its init-method? - #!/usr/bin/env python '''Sample baseline averaging algorithms.''' import numpy as N from pyflix.algorithms import Algorithm class MovieAverage(Algorithm): '''Baseline

Why no tailcall-optimization?

2008-09-22 Thread process
Why doesn't Python optimize tailcalls? Are there plans for it? I know GvR dislikes some of the functional additions like reduce and Python is supposedly about "one preferrable way of doing things" but not being able to use recursion properly is just a big pain in the a**. -- http://mail.python.or

I tried erlang-ish [1|2] in python and something came out...

2008-09-21 Thread process
In erlang you can cons like this: [1|2]. i tried this in python and it didnt raise an error but i dont know what the result do >>> [1|2] [3] >>> [2|2] [2] >>> a = [2|2] >>> a [2] >>> [2|3] [3] >>> [2|1] [3] >>> -- http://mail.python.org/mailman/listinfo/python-list

Re: Is len O(n) or O(1) ?

2008-09-11 Thread process
ok but if len is O(1) then it doesnt matter? compared to if not lista: return [] i mean. -- http://mail.python.org/mailman/listinfo/python-list

Is len O(n) or O(1) ?

2008-09-11 Thread process
Python uses arrays for lists right? def quicksort(lista): if lista == []: lista else: return quicksort([x for x in lista[1:] if x < lista[0]]) + [lista[0]] + \ quicksort([x for x in lista[1:] if x >= lista[0]]) or def quicksort(lista): if len(lista) ==

Re: which of these 2 quicksorts is faster?

2008-09-10 Thread process
On Sep 10, 12:29 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > process wrote: > > qsort can handle bigger lists it seems, making less recursive calls > > before finishing(quicksort blows the stack when sorting > > range(100,-1000,-1). > > qsort does more work thou

which of these 2 quicksorts is faster?

2008-09-10 Thread process
qsort can handle bigger lists it seems, making less recursive calls before finishing(quicksort blows the stack when sorting range(100,-1000,-1). qsort does more work though right? is there a way to speed up that? is the built-in sort not defined recursively? def quicksort(lista): if len(lista

Re: Is try-except slow?

2008-09-02 Thread process
is this faster btw? I guess big doesn't help, it's only retrieved once anyway? But is rows retrieved in every loop? the python interpreter aint too smart? def getPixels(fileName): im = PIL.Image.open(fileName) colors = [] r, c = im.size big = range(0, c) rows = range(0, r)

Re: Is try-except slow?

2008-09-02 Thread process
IndexError: > >                 break > >             colors.append(row) > >     return numpy.array(colors) > > and it appears that you haven't bothered to read the manual section on > Image.getpixel: > """ > Note that this method is rather slow;