Help: py2exe and os.path

Utente prova at prova.it
Sun Apr 28 11:24:52 EDT 2002


----- Original Message -----
From: "Gordon McMillan" <gmcm at hypernet.com>
Newsgroups: comp.lang.python
Sent: Sunday, April 28, 2002 4:34 PM
Subject: Re: Help: py2exe and os.path


[...]
> From import's viewpoint, there is no module named os.path, so
> don't import it.
>
> When you import os, it locates the appropriate module for doing
> path manipulations on your platform, and makes this available
> as "path" (could be posixpath, macpath...). Since it's a global
> of os, it's available as os.path.
>
> -- Gordon
> http://www.mcmillan-inc.com/

Thanks! You're absolutely right!!!
In fact, i disseminated my source with message boxes, (how else could i
debug the exe???) and i discovered that it behaves correctly. If the file
exists, it does some things, if the file doesn't exists it does other
things. In the beginning i thought the problem was the os.path.isfile()
function because i always had the same results (data not loaded and the
error message there).
Now, i discovered that my program stops when i try to load a dictionary via
the shelve module (i posted another help request for that... :) ). The
strange thing is that (again) it works perfectly with the interpreter, but
not with py2exe...

But, at least, now i know where is the real problem.
Thanks again,
Max






More information about the Python-list mailing list