Ahoy Sailors!
So there's two bits to my Python built software, The Parent and the child. The Parent comes in PE executable format so as you can simply right click and view the source. Now we're needing to do the same with the Child applications the Parent is going to me making. Py2Exe by default asks you for a file name, Which it will then open and compile, Somehow I need to alter it as to receive the source of the py file via a variable, As a pose to getting it via opening 'n' reading the file it's self.
The settings script that you pass to Py2Exe will be tucked away safely in the Parent file so you won't be able to see the variable containing the source. I've managed to add my own argument in the settings file to contain the source we actually want to compile.
from distutils.core import setup
import py2exe,sys,os
py2exe_options = dict(
ascii=True, # Exclude encodings
excludes=['_ssl','ssl',], # Exclude standard library
compressed=10,
var = '''import CharmWithTheLadies
import BeastInTheBedroom
print ";-)"
''',
)
setup(name='MythicalMonster',
version='7.0',
description='Cant tell',
author='Why want my autograph?',
zipfile=None,
console=['FAKE.py'],
options={'py2exe': py2exe_options},
)
I've went through the appropriate Py2Exe files adding the special argument (Works). Now They open a handle to the given file name. I've substituted all fp.read()'s to the variable with my source but to no avail. So to simply everything. The goal is to pass the source to your py file in a variable like>
var = ' ' ' import os
import sys
print "Ahoy! " ' ' '
If anyone can solve this problemo I'd be much obliged. You can get the source of the file from the link below. The main two files you'll be needing to look at in there are the build_exe.py and the mf.py files.
http://sourceforge.net/projects/py2exe/files/py2exe/0.6.1/py2exe-0.6.1.zip/download
Have Fun!