There is a python script that creates a .py file and, using the py2exe module imported into the script, compiles this file into a new .exe, on the principle: Running the parent script → creates new_file.py → going to new_file.exe The problem, after parent script with imported py2exe compiled into standalone exe-file, all flow stops at creating .py file: Running parent EXE → creates new_file.py → FINISH!
Who can help and knows how to build an exe from the python script so that it can generate and collect new exe files? Or is it best to raise the server and, when accessing the page, run the script and give it to the user for downloading (I would like of course from the standalone application)?
Body of this type (sorry for krivorukost, brand new):
from distutils.core import setup import py2exe, sys, os import random alphabet="'1234567890qwertyuiop[]asdfghjkl;\zxcvbnm,./~!@#$%^&*()_QWERTYUIOP{}ASDFGHJKL:|ZXCVBNM<>?|" x='y' name= raw_input('enter filename: ') message=''.join([random.choice(alphabet) for x in range(100)]) filename= name+'.py' openedfile = open(filename, 'w') finname= str(filename) wmsg='print('+ '"' + message + '"' + ')\n' + 'os.system("pause")\n' openedfile.write(wmsg) sys.argv.append('py2exe') setup( options = {'py2exe': {'bundle_files': 1, 'compressed': True}}, console = [{'script': filename}], zipfile = None, )