here you are
On Thu, Oct 30, 2014 at 8:37 PM, Ian Dickinson
wrote:
> That would be great can you please send me your script for reference
>
> Thanks
>
> Ian
> On 30 Oct 2014 09:15, "diliup gabadamudalige" wrote:
>
>> I use py2ex.
>> I pack sound, images and fonts as data into py files so that py2exe
>> produces only 1 exe file with no other files or folders. workds only
>> windows.
>> if you like i can send you my py2exe script.
>>
>>
>> On Wed, Oct 29, 2014 at 11:12 PM, Ian Dickinson <
>> ianldickinso...@gmail.com> wrote:
>>
>>> Thanks thats great
>>>
>>> On 29 October 2014 16:58, Thomas Kluyver wrote:
>>>
On 29 October 2014 08:14, NuMedia wrote:
> Can i emulate py2exe for python version 3 and above i also use pygame
> any
> suggestions for a basic staring script would be greatly appreciated
>
I'm involved with two projects that do similar things, and work on
Python 3:
cx_Freeze (http://cx-freeze.sourceforge.net/ ) works in quite a
similar way, to produce an executable for your application, along with a
set of associated files.
Pynsist (http://pynsist.readthedocs.org/en/latest/ ) is more
different: it produces a Windows installer that unpacks the Python files
onto the target user's computer. It's quite new, but there is a pygame
example:
https://github.com/takluyver/pynsist/tree/master/examples/pygame
Thomas
>>>
>>>
>>
>>
>> --
>> Diliup Gabadamudalige
>>
>> http://www.diliupg.com
>> http://soft.diliupg.com/
>>
>>
>> **
>> This e-mail is confidential. It may also be legally privileged. If you
>> are not the intended recipient or have received it in error, please delete
>> it and all copies from your system and notify the sender immediately by
>> return e-mail. Any unauthorized reading, reproducing, printing or further
>> dissemination of this e-mail or its contents is strictly prohibited and may
>> be unlawful. Internet communications cannot be guaranteed to be timely,
>> secure, error or virus-free. The sender does not accept liability for any
>> errors or omissions.
>>
>> **
>>
>>
--
Diliup Gabadamudalige
http://www.diliupg.com
http://soft.diliupg.com/
**
This e-mail is confidential. It may also be legally privileged. If you are
not the intended recipient or have received it in error, please delete it
and all copies from your system and notify the sender immediately by return
e-mail. Any unauthorized reading, reproducing, printing or further
dissemination of this e-mail or its contents is strictly prohibited and may
be unlawful. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
**
try:
from distutils.core import setup
import py2exe, pygame
from modulefinder import Module
import glob, fnmatch
import sys, os, shutil
import operator
except ImportError, message:
raise SystemExit, "Unable to load module. %s" % message
#hack which fixes the pygame mixer and pygame font
origIsSystemDLL = py2exe.build_exe.isSystemDLL # save the orginal before we
edit it
def isSystemDLL(pathname):
# checks if the freetype and ogg dll files are being included
if os.path.basename(pathname).lower() in ("libfreetype-6.dll",
"libogg-0.dll","sdl_ttf.dll"): # "sdl_ttf.dll" added by arit.
return 0
return origIsSystemDLL(pathname) # return the orginal function
py2exe.build_exe.isSystemDLL = isSystemDLL # override the default function with
this one
class pygame2exe(py2exe.build_exe.py2exe): #This hack make sure that pygame
default font is copied: no need to modify code for specifying default font
def copy_extensions(self, extensions):
#Get pygame default font
pygamedir = os.path.split(pygame.base.__file__)[0]
pygame_default_font = os.path.join(pygamedir,
pygame.font.get_default_font())
#Add font to list of extension to be copied
extensions.append(Module("pygame.font", pygame_default_font))
py2exe.build_exe.py2exe.copy_extensions(self, extensions)
class BuildExe:
def __init__(self):
#Name of starting .py
self.script = "Main_LM.py"
#Name of program
self.project_name = "Music Learning"
#Project url
self.project_url = "www.diliupg.com"
#Version of program
self.project_version = "1.0"
#License of the program
self.license = "GPL v2"
#Auhor of program
self.author_name = "Diliup Gabadamudalige"
self.author_email = "dili...@gmail.com"
sel