对静态文件使用esky(和cxfreeze)

2024-04-29 11:56:30 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图使用Esky来更新和冻结python应用程序。但是,应用程序的一部分包括静态文件。在

Esky的表现方式是在文件夹之外创建第二个.exe文件,其中包含我所包含的所有python库和静态数据。在

当我从文件夹本身运行exe时,一切正常,但当我运行esky创建的“bootstrap”exe时,它找不到静态数据(因为它不在同一个相对位置)。在

我想我可以对esky创建的文件夹进行硬编码,但我无法想象这是最好的方法。在

有没有人有什么有用的提示/技巧/解决方案?在

编辑:包含来自esky docs的文件夹结构

prog.exe                     - esky bootstrapping executable
appdata/                     - container for all the esky magic
  appname-X.Y.platform/      - specific version of the application
    prog.exe                 - executable(s) as produced by freezer module
    library.zip              - pure-python frozen modules
    pythonXY.dll             - python DLL
    esky-files/              - esky control files
      bootstrap/             - files not yet moved into bootstrapping env
      bootstrap-manifest.txt - list of files expected in bootstrap env
      lockfile.txt           - lockfile to block removal of in-use versions
      ...other deps...
  updates/                   - work area for fetching/unpacking updates

Tags: 文件ofthe文件夹应用程序forfilesbootstrap