From: Bruno S. <bms...@gm...> - 2004-06-18 10:27:16
|
Hi Tacao, Thanks for your prompt answer, but unfortunatly is still not working. All the glob does is to easy the copy of ".py" or ".pyc" files into the subdirectory "pool". It fails when I try to import a .py file stored in the "pool" module dire= ctory. try: myModule =3D __import__("pool.classnode", globals(), locals(= ), ["getNodeInfo"]) except ImportError, aError: print aError So, I get a error message of : "No module named pool.classnode" This makes me beleive that it is something related in the way that py2exe= stores the module information. Therefore I'm still stucked with the same problem. The current setup.py look like this: # setup.py from distutils.core import setup import py2exe import glob includes =3D ["pool"] setup( version =3D "0.3.5", description =3D "Struct-A-File - Binary File Formatter", name =3D "Struct-A-File", author=3D"Bruno Santos ", author_email=3D"bm...@gm...", # targets to build console =3D ["beefBuilder.py"], scripts =3D ["Node.py", "DataNode.py", "datanodegui.py", "gui.py" ], data_files=3D[("images", ["images/BeefBuilder.ico", "images/add-arrow.bmp", "images/add-node.bmp", "images/subtract.bmp", "images/struct-a-file.gif", "images/export.bmp", "images/new.bmp", "images/open.bmp", "images/save.bmp"]), ("pool", glob.glob("pool/*.py")) ], ) Any further help will be appreciated. Regards, Para ti Tacao penso que posso dizer Muito Obrigado, visto tu pareces ser = Brasileiro e eu Portugues. :) Um abra=E7o. On Fri, 18 Jun 2004 06:42:41 -0300, E. A. Tacao <e.a...@te...> = wrote: > In Friday, June 18, 2004, 6:13:29 AM, Bruno wrote: > > BS> Hi all, > > BS> I've developped a small application in Python and, I'm trying to us= e > BS> py2exe to convert it into an executable. > > BS> My application has a root directory where the main script is along = with > BS> a few others. Then, when executed it loads all the ".py" or ".pyc" > BS> files stored in module "pool" from the root directory. The idea is = that > BS> later on, other users can extend future files that will be used by = the > BS> main application stored in the root directory. > > BS> When converted into an executable, somehow I'm no longer able to lo= ad > BS> the .py files from module pool. I've tryed several ways, but with n= o > BS> success. > > BS> Here is my setup.py configuration: > > BS> # setup.py > BS> from distutils.core import setup > BS> import py2exe > > BS> setup( > BS> version =3D "0.3.5", > BS> author=3D"Bruno Santos ", > BS> author_email=3D"bm...@gm...", > > BS> # targets to build > BS> console =3D ["beefBuilder.py"], > > BS> scripts =3D ["Node.py", > BS> "DataNode.py", > BS> "datanodegui.py", > BS> "gui.py" ], > > BS> data_files=3D[("images", ["images/BeefBuilder.ico", > BS> "images/add-arrow.bmp", > BS> "images/add-node.bmp", > BS> "images/subtract.bmp", > BS> "images/struct-a-file.gif", > BS> "images/export.bmp", > BS> "images/new.bmp", > BS> "images/open.bmp", > BS> "images/save.bmp", > BS> "pool/classnode.py", > BS> "pool/switchnode.py"]) ], > BS> ) > > > BS> Any idea why? > BS> Regards, > > I once needed this and I used glob to do the trick (via py2exe 0.4; I > can't precise if that's still valid for the current version). > Importing glob and changing your data_files to look something like > this may help: > > # file setup.py > [...] > import glob > [...] > data_files=3D[("images", > ["images/BeefBuilder.ico", > "images/add-arrow.bmp", > "images/add-node.bmp", > "images/subtract.bmp", > "images/struct-a-file.gif", > "images/export.bmp", > "images/new.bmp", > "images/open.bmp", > "images/save.bmp"]), > ("pool", glob.glob("pool/*.py*"))] > [...] > > > > -- tacao > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference > Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer > Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA > REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKN= D > _______________________________________________ > Py2exe-users mailing list > Py2...@li... > https://lists.sourceforge.net/lists/listinfo/py2exe-users > > --=20 Bruno Santos mailto:bms...@gm... "Treat people as they ought to be, and you will help them become what they are capable of being." - Goethe Grupo GMV SA. --------------------------------------------------------------------- Isaac Newton, 11 - PTM - Tres Cantos - 28760 Madrid --------------------------------------------------------------------- Phone: 91-8072100 Ext:3362 Fax: 91-8072199 --------------------------------------------------------------------- http://www.gmv.com http://www.gmv.es http://www.gmvsistemas.com http://www.sgi.es --------------------------------------------------------------------- This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. |