[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Mysterious Included Files



Bob Ippolito wrote:
import OpenGL
print OpenGL.__file__

That worked. Thanks!

No, py2exe does not do that. It starts from your main script, and analyzes Python bytecode and looks for import statements (via modulefinder), then it tries to find the modules in a similar way to how Python finds them, and it says they should be included. If you don't want something included, don't import it! You are somehow actually using this code from your other projects, because there is no other way it would find it!

When I run py2exe for this program, none of my own files appear in the list of things it's compiling, yet they show up in the library.zip. And this is when I compile one of the OpenGL NEHE tutorial scripts, which I'm sure doesn't use (for instance) "virtual.py," a piece of code I never released and never included in the tutorial.


Maybe it has something to do with "setup.py"?

# setup.py
from distutils.core import setup
import py2exe
#setup(name = "charm", py_modules = ["ljcharm"], scripts = ["charm"])
setup(console=["lesson08-k.py"])

The "charm" line is from LJCharm, a program I tried to compile earlier; the line is commented out in the original too.

Weird. I guess at worst I could unzip the library and make a new one without the extra files.

Kris
"Give a man a parser, and everything looks like XML."