FAQ
hello,

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.

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.

Looking with a hex editor into some pyc-files,
I see absolute paths to the old directory.

Is this normal,
or am I doing something completely wrong ?

thanks,
Stef Mientki

Search Discussions

  • Steven D'Aprano at Jun 7, 2009 at 4:58 pm

    On Sun, 07 Jun 2009 18:16:26 +0200, Stef Mientki wrote:

    hello,

    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
    ask them?

    https://lists.sourceforge.net/lists/listinfo/py2exe-users

    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
    error message?

    Or perhaps it launches, then immediately exists? Launches, then crashes?
    Does it show up in the process list at all? Or something else?



    --
    Steven

    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()?
    References: <023b8bec$0$20636$c3e8da3@news.astraweb.com>
    Message-ID: <7x63f8dkh6.fsf@ruckus.brouhaha.com>

    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
    tutorial

    http://learnyouahaskell.com/higher-order-functions#folds

    explains this a bit more. You might also like the Real World Haskell
    book:

    http://book.realworldhaskell.org
  • Diez B. Roggisch at Jun 8, 2009 at 4:15 pm

    Stef Mientki wrote:

    hello,

    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.

    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.

    Looking with a hex editor into some pyc-files,
    I see absolute paths to the old directory.
    It is normal, because they refer to the location of the source-files, which
    are needed for stacktraces (or at least something like that)

    But execution itself is independent from this.
    Is this normal,
    or am I doing something completely wrong ?
    Dunno anything about py2exe, but it sure sounds a bit awkward what you do -
    changing locations of files after installation is calling for trouble in
    lots of software. But I might not have understood what you actually did -
    and "doesn't" run isn't helping much in that regard.....

    Diez

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJun 7, '09 at 4:16p
activeJun 8, '09 at 4:15p
posts3
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase