2
我在這個結構中的項目我的Linux機器上:AttributeError的:「名單」對象有沒有屬性「RFIND」使用cx_freeze
project/
changelog
README
src/
install.sh
myproject.py
modules/
a.py
b.py
__init__.py
現在我想用cx_freeze
建立我的項目:
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)]
我做的:
$ python setup.py build
但出現以下錯誤:
AttributeError: 'list' object has no attribute 'rfind'
對不起,但我沒有得到它尚未... – MLSC
而不是'「guifoo.py」'(即一個字符串)分配'['SRC/myproject.py ','src/modules/a.py','src/modules/b.py','src/modules/__ init __。py']'(即一個數組)。而一個數組沒有定義'rfind'方法。我不知道如何更清楚地說出來。如果你不明白我的意思,也許試着重新闡述你的問題。 –
那我該如何改變它? – MLSC