I have a project in this structure on my linux machine:
project/
changelog
README
src/
install.sh
myproject.py
modules/
a.py
b.py
__init__.py
Now I want to use cx_freeze for building my project:
import sys
from cx_Freeze import setup,Executable
includefiles = ['changelog', 'README', 'src/install.sh']
executable = ['src/myproject.py', 'src/modules/a.py', 'src/modules/b.py', 'src/modules/__init__.py']
includes = []
excludes = []
packages = []
setup(
name = 'myproject',
version = '0.1',
description = 'A general enhancement utility',
author = 'user',
author_email = '[email protected]',
options = {'build_exe': {'excludes':excludes,'packages':packages,'include_files':includefiles}},
executables = [Executable(executable)]
I do:
$ python setup.py build
But the following error occurs:
AttributeError: 'list' object has no attribute 'rfind'
You assign an array to executable variable
executable = ['src/myproject.py', 'src/modules/a.py', 'src/modules/b.py', 'src/modules/__init__.py']
but it should be a string. Please refer to manual. An example from the manual:
setup( name = "guifoo",
version = "0.1",
description = "My GUI application!",
options = {"build_exe": build_exe_options},
executables = [Executable("guifoo.py", base=base)])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With