Support
Quality
Security
License
Reuse
kandi has reviewed PySimpleGUI and discovered the below as its top functions. This is intended to give you an instant insight into PySimpleGUI implemented functionality, and help decide if they suit your requirements.
Get all kandi verified functions for this library.
Get all kandi verified functions for this library.
Having fun
Your success
See all related Code Snippets
QUESTION
Specifying folders to be included in pyinstaller exe
Asked 2022-Mar-31 at 13:13So I am writing a test python program with PySimpleGui, and it looks like this:
import PySimpleGUI as sg
import sys
# This bit gets the taskbar icon working properly in Windows
if sys.platform.startswith('win'):
import ctypes
if not sys.argv[0].endswith('.exe'):
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(u'Ethan.FileManager.filemanager.1')
sg.theme('DarkAmber') # Add a touch of color
# All the stuff inside your window.
layout = [[sg.Text('File Manager')],
[sg.Text('Input goes here'), sg.InputText()],
[sg.Button('Ok')]]
# Create the Window
window = sg.Window('File Manager', layout, icon="assets/rickroll.ico")
# Event Loop to process "events" and get the "values" of the inputs
while True:
event, values = window.read()
if event == sg.WIN_CLOSED: # if user closes window or clicks cancel
break
elif values[0] == "":
break
print('You entered', values[0])
window.close()
window = sg.Window('File Manager', [[sg.Text(f'you entered {values[0]}')]], icon="rickroll.ico")
window.close()
I want to distribute this as an executable once I am finished with it, but I am having trouble including the assets folder in the pyinstaller build. If someone could give me a tip on how to include that folder, or point me somewhere that can, that would be great. the files of interest are main.py, and in the assets folder, a file called rickroll.ico. Thanks!
ANSWER
Answered 2022-Mar-31 at 13:13So I did try using base64 encoding for the image, but there was a lot of it and it made my code look a bit wacky, so what I ended up doing was using --add-data "files/icon.ico;files" to package the icon with the exe, and this ended up working along with this answer
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Save this library and start creating your kit
See Similar Libraries in
Save this library and start creating your kit
Open Weaver – Develop Applications Faster with Open Source