Build with PyInstaller

This commit is contained in:
Fedor Lyanguzov
2026-06-09 20:16:36 +03:00
parent 070ae5c85b
commit fed663a054
3 changed files with 16 additions and 1 deletions
+4
View File
@@ -0,0 +1,4 @@
ao-recipes-helper.spec
ao_recipes_helper_gui.egg-info/
build/
dist/
+5
View File
@@ -0,0 +1,5 @@
python -m venv .venv
.\.venv\bin\Activate.ps1
pip install .
pip install pyinstaller
python -m PyInstaller --add-binary .\recipes.db:. --onefile --name ao-recipes-helper main.py --windowed
+7 -1
View File
@@ -1,5 +1,7 @@
import sqlite3 import sqlite3
import io import io
import os
import sys
from PIL import Image, ImageTk from PIL import Image, ImageTk
import tkinter as tk import tkinter as tk
from tkinter import ttk from tkinter import ttk
@@ -138,7 +140,11 @@ def close(root, db):
def main(): def main():
root = tk.Tk() root = tk.Tk()
db = sqlite3.connect("recipes.db") root.geometry("900x900+20+20")
path = "recipes.db"
if hasattr(sys, '_MEIPASS'):
path = os.path.join(sys._MEIPASS, "recipes.db")
db = sqlite3.connect(path)
db.create_function("UPPER", 1, str.upper) db.create_function("UPPER", 1, str.upper)
images = { images = {
a: b a: b