1

I've made a program which launches another python program using os.startfile().

I wanted to have this as two exe files, launching the second by using subprocess.call() instead, in 1 build folder but I can't find how to do this.

I tried making a setup file for both, creating 2 build folders and then copying 1 of the exe files into the other's build folder but got this:

Traceback (most recent call last): 
File "C:\Python34\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 12, 
in <module> __import__(name + "__init__") 
ImportError: No module named 'menu_record__init__'

Any ideas?

Zak D
  • 35
  • 7

1 Answers1

0

I am quite sure that you cannot use two exe in one build folder because although all the dependencies in the build folder are the same the scripts are different.

You can use get two exe in the same build folder with this script.

import sys
from cx_Freeze import setup, Executable

options = {
'build_exe': {'path': sys.path + ['modules']}
}

executables = [
    Executable('script_1.py'),
    Executable('script_2.py')]

setup(
    name='two exe in one folder',
    version='0.1',
    description='Two exe in a single build folder',
    options=options,
    executables=executables)

Check out this other post I made

Also you can copy the second build folder in the first (you will need to rename it to something else not build) and call subprocess.call() to the second build file exe.

Otherwise I have heard (although I have never tried it) that pyinstaller or py2exe (I am not sure which) can make a single file exe.

Xantium
  • 10,258
  • 9
  • 56
  • 83