Probably the reason you’re not getting more reply is because not many people use both Pythoncard and py2exe.  Pythoncard is a low-capability GUI toolkit that is good for beginners but isn’t used much by professionals.  Py2exe is not needed by beginners, only by professionals.  If you are making a program for yourself or maybe one or two friends you don’t need to freeze your application with py2exe.  You can simply run your source code.  My point is to encourage you to continue using Python (and Pythoncard if it’s good enough for your needs) and simply stop using py2exe rather than feeling forced to abandon Python or Pythoncard.

 

From: Mark Heinze [mailto:maanhe4r@gmail.com]
Sent: Monday, April 30, 2012 5:10 PM
To: py2exe-users@lists.sourceforge.net
Subject: Re: [Py2exe-users] TypeError: coercing to Unicode: need string or buffer, NoneType found

 

Hello Again,

 

I've had one kind reply from Jimmy Retzlaff. On his suggestion I did do an intensive (over two days!) search on google and on various forums for " py2exe pythoncard " . What I found is that I could not find a SINGLE case where someone reported success in creating exe using py2exe in an app using Pythoncard. It seems the issue is that the extra resource file  is not recognized by py2exe. Admittedly, I don't have much python programming experience and for that, it's hard to gleen what is wrong in my own setup.py file.

 

Please, if ANYONE has had success in converting a Pythoncard application to an exe using py2exe, would you be so kind as to send me (or post to the forum) the setup.py file you used? Else, I feel I will be following umpteen other budding programmers and be forced to abandon Pythoncard and py2exe.

 

Regards,

Mark Heinze

 

 

On Sat, Apr 28, 2012 at 5:36 PM, Mark Heinze <maanhe4r@gmail.com> wrote:

Hello list,

 

I'm new to Python, wrote my first app and am now trying to make an executable.

I need some help with the exe. Can someone point me in the right direction please?

 

My application consists of three files:

 

wisdom_tooth.py

wisdom_tooth.rsrc.py (a resource file generated from Pythoncard)

wisdom_tooth_thumbnail.jpg

 

The application was written with:

 

Python 2.7.2

wxPyhon 2.8.12.1

Pythoncard 0.8.2

 

My setup.py file looks like this:

 

from distutils.core import setup

import py2exe

Mydatafiles = [('images', ['C:\Python27\mark27\myexe\wisdom_tooth_thumbnail.jpg'])]

setup(

    windows=['wisdom_tooth.py'],

    datafiles = Mydatafiles

    )

 

The process seems to work fine using "python setup.py py2exe" in the command prompt window.

When I try to run the resulting "wisdom_tooth.exe" in the dist folder, the log results:

 

Traceback (most recent call last):

  File "wisdom_tooth.py", line 269, in <module>

  File "PythonCard\model.pyc", line 366, in __init__

  File "PythonCard\resource.pyc", line 45, in __init__

  File "PythonCard\util.pyc", line 39, in readAndEvalFile

TypeError: coercing to Unicode: need string or buffer, NoneType found

 

Can anybody tell me what issue is here and what I need to do to resolve it?

What more information could I post that would help?

Has anyone else had success compiling an application made with Pythoncard using Py2exe?

Is there a search function for the archive of the py2exe-users list (I've only been able to browse)?

 

Thanks, 

Mark Heinze