def select_json(): selection = filedialog.askopenfilename(initialdir=getcwd(), title='Select project json file') _jsonVar.set(selection) print('Selected json file: {}'.format(_jsonVar.get()))