The py2exe executable does not start

Update 3: I used pyinstaller + sent my code in one script and it works great!

Update 2: I put all my scripts in one .py file, but there are as many as 2000 lines and it really is not how I would like. Be that as it may, this brings me to a new error / solution path, but I want to know the answer to the question of how to generate an .exe file with py2exe if outsourced in different scenarios, so if you have have some idea ...

Update 1: I tried with a simple GUI: it works, but I tried to launch a simple GUI from another module and it doesn't work, so I think there is something definite here, I don't know if I'm clear, but I have a "simple GUI" that works, but I tried the "launcher" which basically just imported the "simple GUI" and ran it, but it doesn't work.

Since yesterday, I have completed a piece of code that I have been working on for two weeks. It works great when I run it from python and do exactly what I want.

But - there is always something, but - the point is that I don't want my end user to have to install python or even use Portable Python (which I use, by the way, version 2.7.2.1 on windows xp 32 bit if It helps).

I would like the program to be a standalone exe at best, or at least a folder with a lot of files and an executable.

So I did some research before going here and I discovered py2exe. I struggled with this for a while, but now I finally managed to create a folder with a lot of files and an executable.

And what do you say? Well, when I run the executable, nothing happens. This is not exactly the case, the prompt window appears for 1 second, then closes and then nothing happens, whereas the GUI should show.

I don't know if the problem occurs, but my program is split into different modules like gui.py, calc.py, blablabla.py, etc.

I've tried to solve my problem but haven't found anything interesting so far.

Here is my setup.py:

from distutils.core import setup
import py2exe
setup(console=['guiapp.py'])

      

The module that I run in python and that runs all guiapp.py:

import MainWindowApp
import CumulativeLogger
import logging
import gettext
_ = gettext.gettext

logging.basicConfig()
l = logging.getLogger()
l.setLevel(logging.INFO)
cl = CumulativeLogger.CumulativeLogger()
l.info(_('Lancement du Programme'))
MainWindowApp.MainWindowApp(cl).run()

      

Finally, MainWindowApp.py (shorthand), which should launch the GUI:

from Tkinter import *
import tkMessageBox
import tkFileDialog
import logging
import ViewLog
import ThreadsConnector
import ActionWindow
import gettext
import app2
_ = gettext.gettext
import os

class MainWindowApp:
    def __init__(self, log):
        self.log    = log
        self.logger = logging.getLogger(self.__class__.__name__)

    def run(self):
        self.root = root = Tk()
        root.title(_('QuickGen'));

        #Buttons and things like that

        root.mainloop()

    def alotoffunctiontomakeitrun

      

By the way, I should mention that I tried to replace all my code with a little GUI that does nothing but there, and it worked, so I really don't know what to think ...

+3


source to share





All Articles