Pyinstaller --add-data参数详解
原文链接:kivy - Pyinstaller adding data files - Stack Overflow
As others (@Anson Chan, @schlimmchen) have said:
If you want to add some extra files, you should use Adding Data Files.
Two ways to implement
- Command Line: add parameter to
--add-data
- Spec file: add parameter to
datas=
- Generated when running
pyinstaller
the first time.- Then later you can edit your
*.spec
file. - Then running
pyinstaller
will directly use your*.spec
file.
- Then later you can edit your
- Generated when running
Parameter
Logic
Parameter in --add-data
or datas=
:
--add-data
:- format:
{source}{os_separator}{destination}
os_separator
:- Windows:
;
- Mac/Linux/Unix:
:
- Windows:
source
anddestination
- Logic:
source
: path to single or multiple files, supporting glob syntax. Tells PyInstaller where to find the file(s).destination
file or files: destination folder which will contain your source files at run time. * NOTE: NOT the destination file name.- folder: destination folder path, which is RELATIVE to the destination root, NOT an absolute path.
- Logic:
- Examples:
- Single file:
'src/README.txt:.'
- multiple files:
'/mygame/sfx/*.mp3:sfx'
- folder:
/mygame/data:data'
- Single file:
- format:
datas=
- Format: list or tuple.
- Examples: see the following.
added_files = [( 'src/README.txt', '.' ),( '/mygame/data', 'data' ),( '/mygame/sfx/*.mp3', 'sfx' )
]a = Analysis(...datas = added_files,...
)
Your case
For your (Windows OS) here is:
--add-data
in command linepyinstaller -F --add-data "main.kv;." yourtarget.py
OR:
datas=
inyourtarget.spec
file, see following:
a = Analysis(...datas = ["main.kv", "."],...
)
Pyinstaller --add-data参数详解相关推荐
- Java Spring Data Redis实战与配置参数详解 application.properties...
Redis作为开源分布式高并发缓存,使用范围非常广泛,主流互联网公司几乎都在使用. Java Spring Boot 2.0实战开发Redis缓存可以参考下面的步骤,Redis安装可以直接使用Linu ...
- 备份数据库的expdp语句_Oracle数据库备份恢复Data Pump Expdp/Impdp参数详解与案例介绍...
oracle数据库备份恢复Data Pump Expdp/Impdp参数详解与案例介绍 目 录 1 Oracle数据泵的介绍 3 2 Oracle expdp/impdp参数使用介绍 3 2.1 Or ...
- linux top VIRT RES SHR SWAP DATA内存参数详解
Linux top VIRT RES SHR SWAP DATA内存参数详解 其实很早之前就想开博客,写一写码农几年自己积攒下来的知识与见解.看过很多文章有过很多感触,有些收获很值得梳理一下认真思考反 ...
- Java Spring Data Redis实战与配置参数详解 application.properties
Redis作为开源分布式高并发缓存,使用范围非常广泛,主流互联网公司几乎都在使用. Java Spring Boot 2.0实战开发Redis缓存可以参考下面的步骤,Redis安装可以直接使用Linu ...
- Data Guard参数详解
Oracle 11g Dataguard参数详解 就Data Guard(后面都写成DG)来说,我们只关注如下三种参数: 1.独立于数据库角色的参数 2.数据库角色为primary时的参数 3.数据库 ...
- 一文搞定 Spring Data Redis 详解及实战
转载自 一文搞定 Spring Data Redis 详解及实战 SDR - Spring Data Redis的简称. Spring Data Redis提供了从Spring应用程序轻松配置和访问 ...
- Docker运行参数详解
Docker运行参数详解 docker search 参数: MacdeMacBook-Pro:~ mac$ docker network create --helpUsage: docker net ...
- 【学习笔记】sed 命令及参数详解
sed 命令及参数详解 标签:Sed 文章目录 sed 命令及参数详解 一.简介 二.基本用法 2.1. 三种方式 2.2. 常用选项 2.3. 命令体的组成 2.3.1. 定位文本部分 2.3.2. ...
- CI流水线配置文件参数详解(二)
文章目录 4. 参数详解(二) 4.9 git tag打标签的使用 4.10 ``allow_failure`` 4.11 ``when`` 关键字用于实现在作业失败时或发生故障时运行的作业 (whe ...
- LNMP nginx1.4.6+php5.5.11+mysql5.6.17+mecache+opcache编译安装+opcache参数详解+opcache可视化php页面代码
可能要用到的软件: libiconv-1.13.tar.gz libmcrypt-2.5.8.tar.gz mcrypt-2.6.8.tar.gz mhash-0.9.9.9.tar.gz m ...
最新文章
- cygwin执行.py提示找不到模块,但已经安装模块的解决办法
- 影响生产计划制定的因素_石料生产线选砂石原骨料时的技巧及影响破碎的因素...
- 【深度学习】U-Net 网络分割多分类医学图像解析
- 2017上半年软考 第六章 重要知识点
- 不同函数之间的跳转setjmp和longjmp
- 回调函数之Java/C++版本
- 【转】android-修改TextView中部分文字的颜色
- Starlink的20ms延迟怎么计算得到的?
- 微信小程序性别代码对应描述
- java二维码小试牛刀
- springboot智慧幼儿园管理系统的设计与实现毕业设计源码271611
- IDEA 修改文件编码
- h5抽奖大转盘开发笔记小结,涉及到的知识点和包资源
- DASCTF X GFCTF 2022十月挑战赛 WriteUp
- Scala+HuffmanCoding实现无损压缩
- win10需要修复计算机,超好用!Win10自带修复系统 隐藏太深
- 简单的方法爬取b站dnf视频封面步骤解释
- J9数字论:什么是DAO模式?DAO发展过程的阻碍
- Python 抓取知识星球内容生成词云并生成 PDF
- MUI-list(列表),普通列表、带箭头列表、带数字角标列表、带图文列表
热门文章
- ora-12514解决方法
- 23_使用dtree展示所有分类
- JAVA 基础语法(二)——基本数据类型转换以及运算符
- ubuntu如何修改terminal终端的主机名
- [Material Design] MaterialButton 效果进阶 动画自动移动进行对齐效果
- [JNI]开发之旅 (3)jni域描述符说明
- 使用tcpdump抓Android网络包
- [2018.09.05 T1] Lyk Love painting
- vuex实例方法replaceState解决vuex页面刷新数据丢失问题
- v-for循环下动态绑定ref后undefine的解决方式