1

我想制作一个 mac os x 应用程序来分发我的程序。

问题是当前脚本将“images/Diagram.png”和“images”文件夹下的其他文件放入“Resources”,但没有按预期放入“Resources/images”

为了将 png 文件放在图像下,我可以在 setup.py 部分中进行哪些更改?

mainscript, ico, icns = "aproxim.py", "sum.ico", "sum.icns"

files = ["images/Diagram.png", "images/document.png", "images/Exit.png", "images/floppydisc.png",
         "images/folder.png", "images/Info.png", "images/settings.png"]
scripts = ["app_settings_dialog", "app_window", "approximator", "approximator2", "data_format",
           "easy_excel", "functions", "main_window", "settings_dialog",
           "util_data", "util_parameters"]

description = "Approximator is program for experimental data approximation and interpolation (20 dependencies for select)"

common_options = dict(name = "Approximator", version = "1.7", description = description)

if sys.platform == 'darwin':
    setup(
        setup_requires = ['py2app'],
        app = [mainscript],
        options = dict(py2app = dict(includes = scripts, resources = files, iconfile = icns)),
        **common_options)
4

1 回答 1

1

很简单,希望对其他 Python 开发者有用:

resources = [('images', files), ('', [ico])]
于 2012-12-09T07:00:05.940 回答