目录
关于在Linux用pyinstaller打包请看https://blog.csdn.net/weixin_68360041/article/details/136399184?spm=1001.2014.3001.5501
一、创建shell脚本
进入创建文件夹的目录的终端,创建空白文件。
# 创建一个xxx.sh 文件
[root@debian~]# touch Helloword.sh
# 编辑xxx.sh 文件
[root@debian~]# vim xxx.sh
[root@debian~]# cat xxx.sh
#!/bin/bash
echo "hello world"
# 赋予执行权限
[root@debian~]# chmod o+x xxx.sh
# 运行xxx.sh 脚本
[root@debian~]# ./xxx.sh
hello world
右击进入文本编辑,或者进入vi、vim编辑器 ,输入#!/bin/bash作为文件开头,保存文件就是shell文件了,再在其中添加命令。
#!/bin/bash
二、 运行可执行文件
1、与可执行文件在同一目录下
#!bin/bash
./manage runserver --noreload
2、与可执行文件不在同一目录下
cd 定位到文件的绝对位置
#!bin/bash
cd /绝对路径/.../可执行文件名
./manage runserver --noreload
3、作为程序运行
右击出现“作为程序运行”,没有就打开属性,有个“作为程序运行”的按键,打开就好咯
也可以用终端打开,终端定位到xxx.sh的目录下
[root@debian~]# ./xxx.sh