0

I have create with wxpython flatmenu an application and i was using GUi2EXE to make my program executable and i take the follow error:

File "myflat.py", line 411, in
File "myflat.py", line 47, in init
File "myflat.py", line 262, in CreateMenu
File "FlatMenu.pyc", line 2301, in init
File "ArtManager.pyc", line 1617, in CreateGreyBitmap
File "wx_gdi.pyc", line 668, in SaveFile
wx._core.PyAssertionError: C++ assertion "bmp.Ok()" failed at
  ....\src\msw\dib.cpp(148) in wxDIB::Create(): wxDIB::Create(): invalid bitmap

I check the names of the icons i use, i search everything and i cant find what is going on can anyone help me please?

4
  • Along with the traceback, could you show the code that produced the assertion? The lines around Line 262 of myflat would be a good starting point.
    – Mark
    Commented Feb 1, 2012 at 21:35
  • @TLSK, you have 0% acceptation rate. If you want to increase your chance of getting attention, please accept (check the mark) some of the previous valid answers to your questions as other people already asked you to do.
    – joaquin
    Commented Feb 1, 2012 at 22:03
  • Artmanager code is here
    – TLSK
    Commented Feb 1, 2012 at 22:33
  • I find something about my question but i cant understand here
    – TLSK
    Commented Feb 2, 2012 at 0:09

1 Answer 1

1

I guess I will just answer since I cant comment yet -.- Here is what I use:

First, download and install py2exe if you haven't already, preferably using easy_install (a script plugin for python that lets you download things and automatically install them to your python path), make a file in whatever directory you are keeping your project in called setup.py, and place in the following code:

from distutils.core import setup
import py2exe

setup(
     console = [
         {
             "script": "yourscipt.py",
             "icon_resources": [(1, "youricon.ico")]
         }
     ],
)

after that, open a command prompt window in the setup.py file's directory, and type:

setup.py py2exe install

that will then spit out loads of output as it compiles your script, sets the icon, and finds the needed libraries for it. After that all is done, you will have two folders, one named build, the other named dist. The only folder you need is dist, where you will find your executable.

I hope this helped!

2
  • I did it but when it compiles an error stop the compiling and when i try to run the executable file in dist folder i take the folow error Runtime error R6034, An application has made an attempt to load C runtime ibrary incorrectly.
    – TLSK
    Commented Feb 2, 2012 at 22:53
  • I would go then with what the debugger outputted and look up how to properly us C runtime libraries, I have little experience with C and its associated libraries sorry!
    – CR0SS0V3R
    Commented Feb 3, 2012 at 0:29

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.