Well in your case, when py2exe creates the executables, you won't be launching a .py file you would be launching the .exe file.

os.system(script + ".exe")

When you say "it is not working", what exactly is not working. is py2exe not creating the executables or do the executables crash when you run them.

-Thadeus

http://thadeusb.com


Andy Warhol  - "I am a deeply superficial person."

On Wed, Apr 8, 2009 at 12:56 PM, Chris Cordner <Chris.Cordner@northernrail.org> wrote:
Hi
 
See attached bit of code
 
scripts = dict(a = "refund", b = "seasonref", c = "priv", d = "changeover", q = quit)
choice = menu()
script = scripts[choice]
if scripts == "quit":
    exitapp()
else:
    os.system(script + ".py")
I think I am running them as a separate Python process (New to this I am afraid).
 
But yes, I am passing the 'py2exe' argument
 
Thanks very much for your help
Chris
 
Chris Cordner
Area Retail Skills Assessor
 
Northern Rail Limited
Bradford Interchange
Bridge Street
Bradford
BD1 1JY
 
Tel: 07764 796 275
Email: chris.cordner@northernrail.org
 


From: thadeus.burgess@gmail.com on behalf of Thadeus Burgess
Sent: Wed 8.4.09 18:49
To: Chris Cordner

Subject: Re: [Py2exe-users] FW: Py2exe

Are you including your scripts into your program or is it being launched as another separate python process?

If you are just including them, you just need to replace "script": 'filename.py' with "console": "main.py"

py2exe will gather most of the needed dependencies.

So if you have a.py that includes b.py, all you need to put in the console dict is a.py, it will include b.py because it see's that as being included in the program.

Also, when you run the setup.py make sure you are passing a py2exe argument.

'python setup.py py2exe'

Hope that helps.

-Thadeus

http://thadeusb.com


George Burns  - "I spent a year in that town, one Sunday."

On Wed, Apr 8, 2009 at 12:42 PM, Chris Cordner <Chris.Cordner@northernrail.org> wrote:
Hi
 
I am using Python 2.5 on Windows XP.
 
I have produced a short script, called 'project.py', which displays a menu, allowing the user to select an option. Depending on what they choose, it then runs a separate script, such as 'refund.py', 'changeover.py', 'seasonref.py' or 'priv.py'
 
I have run this as a python script and via the command line, but when I use py2exe to create an executable, it doesn't work.
 
My original setup file looked like this;
 
from distutils.core import setup
import py2exe
setup(
    console = [
        {
            "script": "changeover.py",                 
            "icon_resources": [(0, "tickets.ico")]     ### Icon to embed into the PE file.
        }
    ],
)
 
So I tried changing it to this;
 
from distutils.core import setup
import py2exe
setup(
    console = [
        {
            "script": "changeover.py",                
     "script": "refund.py",   
     "script": "seasonrefund.py",
     "script": "priv.py",
     "script": "project.py",
            "icon_resources": [(0, "tickets.ico")]     ### Icon to embed into the PE file.
        }
    ],
)
 
And had no more success.
 
Any ideas? I would like to keep them as separate scripts, because each one could be quite involved.
 
Thanks
Chris
 
Chris Cordner
Area Retail Skills Assessor
 
Northern Rail Limited
Bradford Interchange
Bridge Street
Bradford
BD1 1JY
 
Tel: 07764 796 275
Email: chris.cordner@northernrail.org
 


Attention:

This email is confidential and intended for the named addressee only.

Any views or opinions expressed and presented are those of the author
and do not necessarily represent those of Northern Rail Ltd.

If you are not the intended recipient then you have received
this email in error and any use, disclosure, forwarding, printing,
copying and distribution is strictly prohibited.

If you have received this transmission in error please contact and
notify the sender. Thank you for your co-operation.

This email was scanned and cleared by the Northern Rail Ltd Information Services Department.



------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Py2exe-users mailing list
Py2exe-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/py2exe-users



Attention:

This email is confidential and intended for the named addressee only.

Any views or opinions expressed and presented are those of the author
and do not necessarily represent those of Northern Rail Ltd.

If you are not the intended recipient then you have received
this email in error and any use, disclosure, forwarding, printing,
copying and distribution is strictly prohibited.

If you have received this transmission in error please contact and
notify the sender. Thank you for your co-operation.

This email was scanned and cleared by the Northern Rail Ltd Information Services Department.