created pypack

This commit is contained in:
ocueye 2024-11-11 16:33:51 +00:00
commit bbb8b1dc15
3 changed files with 39 additions and 0 deletions

1
pypack/requirements.txt Normal file
View File

@ -0,0 +1 @@
cherrypy

36
run.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/bash
#pypack
#by ocueye2
version="3.12"
program="start.py"
# check if venv exists (to see if script has run before)
if [[ -f "pypack/.venv/env/bin/activate" ]]
then
echo "starting"
else
echo "installing"
cd pypack
sudo apt update
# install requirements
if ! command -v "python$version" &> /dev/null
then
sudo apt-get install "python$version"
fi
# make a venv
mkdir .venv
cd .venv
"python$version" -m venv env
source env/bin/activate
cd ..
pip install -r requirements.txt
cd ..
deactivate
fi
source pypack/.venv/env/bin/activate
python "$program"

2
start.py Normal file
View File

@ -0,0 +1,2 @@
import cherrypy
print("complete")