From 66569ef2b21c1fced127a452ae0e8ae69743b7bd Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Thu, 4 Nov 2021 16:32:32 -0400 Subject: [PATCH] Automatically fill in the Python interpreter so that a pinnable shortcut is created --- DemoPrograms/Demo_Make_Windows_Shortcut.pyw | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DemoPrograms/Demo_Make_Windows_Shortcut.pyw b/DemoPrograms/Demo_Make_Windows_Shortcut.pyw index bb3f3950..4b2c4fdc 100644 --- a/DemoPrograms/Demo_Make_Windows_Shortcut.pyw +++ b/DemoPrograms/Demo_Make_Windows_Shortcut.pyw @@ -142,15 +142,17 @@ def main(): main_icon = b'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACWElEQVRYR7WXO2tVQRSFv7QWRmMIIggKAUW0SKNFGvMjFLsUooWPNIqVoqI2ShpFQbCwFNME/QMWggqCj0pQJIiSIkSSQgVRkHWZCTs7Z85rxg2Xe8+ZuXuts2ftNXOG+D+xE9gL7AH+AB+Aj8A3DzdUGH8CuAAcS+R9CpwLZAZTShK4HMA3tXioK8DVkgQErqQ2VoEvwF9gF7DFjYvorxIVqAJfe0ID+hg4Yq5vABdzCbQFj7h+/lgOga7gkcQKMBwupvoS6Asu3PfAgUDgdB8COeDZBMaBV8CIEVOV4Oo6MWsJbgNnM8CzRDgKLBnwOeBoC9OJU24B5838O8BMFw1MAs9DApVxq0n2ANgGvI0O54gJ7Iy59x04BHzqQuAkcD8kEZB8X3EKuGuS7wAWzfU1GY4j1MuKUwT0JC8NwKwptcS6nALX/VQFZJn7gHfAfEhQtwRenGNBL/L7H3WirSJglboA7A4JvAgHIjLJ17UX8CyMxYd5AzzxovUEfJt8BXS4iCENaCliTBmgdQ4H3GvTIZZAlcNdAq6bRCKjLTbGCUAdoMgiUOVwKq/K7ENEDwKfnSmllqC2ELECXkQyDKm5bWxwOGdayTwikOtwHtyLs7ECde3VVAEPvuZwTX+M46pAymCacuRuy4P8fQkUAY8Eui5BMfBIoIsIi4JHAvp+CEybRW9zrNb0rqehDbqKPrAZ0IuEDdnwi7CZHA4vF3Y8G9xWQL+rylvVCT+Bm4mDR1PnJCsQB7YH7z+eyPQogGtnKxKp88B+QN2hz++w470Or9lFgGOSf3MNjp/Wcz63AAAAAElFTkSuQmCC' sg.set_options(keep_on_top=True) python_command = sg.execute_py_get_interpreter() + if not python_command: + python_command = sys.executable sg.theme('dark grey 13') - txt_size = 40 + txt_size = 45 layout = [[sg.Text('Create Windows shortcut (Click Create Shortcut or return key to start)', font='_ 15')], [sg.T('Python (.PY/.PYW), EXE or other file - (absolute path)', s=txt_size), sg.Input(key='-IN FILE-'), sg.FileBrowse(file_types=(("Python Files", "*.py *.pyw *.PY *.PYW"),), )], [sg.T('Icon file (optional)', s=txt_size), sg.Input(key='-ICON-'), sg.FileBrowse(file_types=(("Icon Files", "*.ico *.ICO",),), )], [sg.T('Shortcut Name (optional)', s=txt_size), sg.Input(key='-SHORTCUT NAME-')], - [sg.T('Python Command (optional)', s=txt_size), sg.Input(python_command, key='-PYTHON COMMAND-')], + [sg.T('Python Command (optional, required for pinning to taskbar)', s=txt_size), sg.Input(python_command, key='-PYTHON COMMAND-')], [sg.T('Arguments (optional)', s=txt_size), sg.Input(key='-ARGUMENTS-')], [sg.Button('Create Shortcut', bind_return_key=True), sg.Button('Exit')]]