added pyinstaller find current folder

This commit is contained in:
Fredrick W. Warren 2022-05-30 20:49:11 -07:00
parent e3b3cc67bd
commit 817293f669

View File

@ -1,8 +1,16 @@
import os
import PySimpleGUI as sg import PySimpleGUI as sg
from PIL import Image, ImageDraw, ImageEnhance, ImageFilter, ImageFont, ImageOps from PIL import Image, ImageDraw, ImageEnhance, ImageFilter, ImageFont, ImageOps
from io import BytesIO from io import BytesIO
# Globals
def resource_path(relative_path):
""" Get absolute path to resource, works for dev and for PyInstaller """
try:
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
return os.path.join(base_path, relative_path)
def update_image(original, title, subtitle): def update_image(original, title, subtitle):