linux 打包成bin文件

关于bin文件主要有两部分组成,一部分shell脚本,一部分压缩文件

| |

| shell |

____________

| |

|   压缩文件 |


先编写一个install.sh,如下:

#!/bin/sh

dst_dir="./bin" #bin文件分离压缩文件存放的目录

sed -n -e '1,/^exit 0$/!p' $0 > ''$dst_dir/abc.tar.gz" 2>/dev/null

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要将 Python 文件打包 apk 文件,您可以使用 Kivy 框架。Kivy 是一个跨平台的 GUI 库,可以使用 Python 开发桌面应用程序、移动应用程序和游戏。 首先,您需要安装 Kivy。您可以使用 pip 命令安装 Kivy: ``` pip install kivy ``` 然后,使用 Kivy 创建一个 Python 文件,并在文件中编写代码。例如,以下是一个简单的 Kivy 程序: ```python from kivy.app import App from kivy.uix.label import Label class MyApp(App): def build(self): return Label(text='Hello World!') if __name__ == '__main__': MyApp().run() ``` 接下来,使用 buildozer 工具打包应用程序。首先,您需要安装 buildozer: ``` pip install buildozer ``` 然后,在应用程序的根目录中创建一个名为 buildozer.spec 的文件,其中打包设置。例如,以下是 buildozer.spec 的示例内容: ``` [app] # (str) Title of your application title = My Application # (str) Package name package.name = myapp # (str) Package domain (needed for android/ios packaging) package.domain = org.test # (str) Source code where the main.py live source.dir = . # (list) Source files to include (let empty to include all the files) source.include_exts = py,png,jpg,kv,atlas # (list) Source files to exclude (let empty to not exclude anything) source.exclude_exts = spec # (list) List of directory to exclude (let empty to not exclude anything) source.exclude_dirs = tests, bin # (list) List of exclusions using pattern matching #source.exclude_patterns = license,images/*/*.jpg # (str) Application versioning (method 1) version = 0.1 # (str) Application versioning (method 2
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值