import PySimpleGUI as sg import subprocess import sys, os if len(sys.argv) > 1: cmd = "python scripts/run.py " + str(sys.argv[1] ) print(cmd) p = subprocess.Popen(cmd, shell=True) else: fname = sg.Window('Files exporter', [[sg.Text('Folder to export')], [sg.In(), sg.FolderBrowse()], [sg.Open(), sg.Cancel()]]).read(close=True)[1][0] if not fname: sg.popup("Cancel", "No filename supplied") raise SystemExit("Cancelling: no filename supplied") else: # sg.popup('The filename you chose was', fname) print(fname) cmd = "python scripts/run.py " + str(fname) print(cmd) p = subprocess.Popen(cmd, shell=True)