From: jim-on-linux <in...@ve...> - 2007-01-26 04:45:35
|
Thanks for responding, I don't have a problem producing an exe file. The=20 problem has been narrowed down to my last post. I made the set up is as simple as I can get it.; the setup builds the dist dir and the build dir.=20 But the dis dir only contains the tcl dir and=20 nothing else. Correctly built it will contain lib.zip,=20 msvcr71.dll and other stuff along with an exe=20 file. There is an error in what I submitted below but I=20 haven't been able to find it.=20 ## setup is below should produce an exe file if=20 the TESTPRT.py is valid. >#!/usr/bin/env python >import sys >from distutils.core import setup >import py2exe >setup( > =A0 version =3D "Test", > =A0 description =3D "win 32 sample", > =A0 name =3D "Test exe", > =A0console =3D ["TESTPRT.py"], > =A0 ) ### below is the code for TESTPRT.py that will run=20 from IDLE and print, "Test Line Sent". but when running setup.py, it does not produce the=20 expected exe file or anything else. ##TESTPRINT.py=20 >import win32ui > >from distutils.core import setup >import py2exe > >def PrintLine(): > =A0 =A0 =A0 =A0dc =3D win32ui.CreateDC() > =A0 =A0 =A0 =A0dc.CreatePrinterDC() > =A0 =A0 =A0 =A0dc.StartDoc('Test File') > =A0 =A0 =A0 =A0dc.StartPage() > =A0 =A0 =A0 =A0dc.TextOut(20,10, 'Test Line Sent') > =A0 =A0 =A0 =A0dc.EndPage() > =A0 =A0 =A0 =A0dc.EndDoc() > =A0 =A0 =A0 =A0del dc > >if __name__ =3D=3D '__main__': > =A0 PrintLine() On Thursday 25 January 2007 20:32, John Machin=20 wrote: > On 26/01/2007 11:43 AM, jim-on-linux wrote: > > py2exe help, > > > > I'm trying to build an exe file on XP Pro. > > For some reason I can't determine why the > > file below will not produce an exe file. > > What are you typing in when you are trying to > produce an exe file? Do you have a setup.py > file as well as the file you show at the end of > the message? > > Please give a comprehensive answer along these > lines: 1. I type: > \python25\python setup.py py2exe > 2. Here is my setup.py: > from distutils.core import setup > import py2exe > setup(console=3D['printline.py']) > 3. Here is printline.py: > blah > blah > etc > > > Dist and build directories are built but no > > exe file. > > > > This file will run by itself and print "Test > > Line Sent". > > > |