1 Star 0 Fork 2

ppnt/pandora-cloud

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.py 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
李通 提交于 2023-10-13 20:31 +08:00 . 制定输出的目录
import os
import platform
def construct_pyinstaller_command():
# Get the system name (e.g., 'Windows', 'Linux', 'Darwin' for macOS, etc.)
system_name = platform.system()
# Get the detailed architecture identifier
arch_name = platform.machine()
output_name="pandora-cloud"
# Construct the output name
output_folder_name = f"{output_name}-{system_name.lower()}-{arch_name}"
# Determine the appropriate path separator for --add-data based on the OS
path_separator = ";" if system_name == "Windows" else ":"
# Specify the output directory for the bundled app
dist_path = f"dist/{output_folder_name}"
# Construct the PyInstaller command
command = (f'pyinstaller --onefile --name {output_name} '
f'--distpath {dist_path} '
f'--add-data "src/pandora_cloud/flask/static{path_separator}flask/static" '
f'--add-data "src/pandora_cloud/flask/templates{path_separator}flask/templates" main.py')
return command
if __name__ == "__main__":
pyinstaller_command = construct_pyinstaller_command()
print(pyinstaller_command)
os.system(pyinstaller_command)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/ppnt/pandora-cloud.git
git@gitee.com:ppnt/pandora-cloud.git
ppnt
pandora-cloud
pandora-cloud
master

搜索帮助