creating exe using cx_freeze, but move exe to root directory to deploy

偶尔善良 提交于 2019-12-24 15:27:19

问题


I created a new script with cx_freeze's template. Then I'm running python setup.py build to create the exe. If I move main.exe to the root folder cx_freeze test it will fail to run.

All I want is to move .exe up 1 or two directories. Here's my code:

main.py

foo = input("Complete")

setup.py:

from cx_Freeze import setup, Executable

# Dependencies are automatically detected, but it might need
# fine tuning.
buildOptions = dict(
    packages = [],
    excludes = [],
    includes = ["atexit"]
)
    # include_files=[]

base = 'Console'

executables = [
    Executable('main.py', base=base, targetName = 'main.exe')
]

setup(name='freeze test',
      version = '1',
      description = '.',
      options = dict(build_exe = buildOptions),
      executables = executables)

I thought http://cx-freeze.readthedocs.org/en/latest/faq.html#using-data-files might have some help, but since the files are in the subdirectory, I can't use os module?


回答1:


That feature is not available in 4.x but will be available in 5.x when it is made available. The current source has this capability so if you can compile it you can have it today; otherwise, you'll need to wait for the official release which I hope will be soon.



来源:https://stackoverflow.com/questions/36273298/creating-exe-using-cx-freeze-but-move-exe-to-root-directory-to-deploy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!