On Sun, 07 Jun 2009 18:16:26 +0200, Stef Mientki wrote:
AFAIK I read that pyc files can be transferred to other systems. I
finally got a windows executable working through py2exe, but still have
some troubles, moving the directory around.
Sounds like a py2exe problem, not a Python problem. Perhaps you should
I use Python 2.5.2.
I use py2exe to make a distro
I can unpack the distro, on a clean computer, anywhere where I like, and
it runs fine.
Now when I've run it once,
I move the subdirectory to another location, at it doesn't run.
Define "doesn't run".
You mean the exe file doesn't launch at all? Does Windows display an
Or perhaps it launches, then immediately exists? Launches, then crashes?
Does it show up in the process list at all? Or something else?
From http Sun Jun 7 19:25:41 2009
From: http (Paul Rubin)
Date: 07 Jun 2009 10:25:41 -0700
Subject: Is reduce() foldl() or foldr()?
Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> writes:
Calling all functional programming fans... is Python's built-in reduce()
a left-fold or a right-fold?
It's a left fold.
but other people say it's a right-fold, e.g.:
"... there is a `foldr` in Haskell that just works like `reduce()`"
That is correct in the sense that a coding situation where you'd use
reduce in Python would often lead you to use foldr (with its different
semantics) in Haskell. This is because of Haskell's lazy evaluation.
Example: suppose you have a list of lists, like xss =
[[1,2],[3,4,5],[6,7]] and you want to concatenate them all. (++) is
Haskell's list concatenation function, like Python uses + for list
concatenation. So you could say
ys = foldl (++)  xss
but if I have it right, that would have to traverse the entire input
list before it gives you any of the answer, which can be expensive for
a long list, or fail totally for an infinite list. foldr on the other
hand can generate the result lazily, in sync with the way the caller
consumes the elements, like writing a generator in Haskell. The
explains this a bit more. You might also like the Real World Haskell