• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Select files and folders with Tkinter’s filedialog

Resolved: Select files and folders with Tkinter’s filedialog

0
By Isaac Tonny on 04/04/2023 Issue
Share
Facebook Twitter LinkedIn

In this post, we will see how to resolve Select files and folders with Tkinter’s filedialog

Question:

I want to select files and folders with filedialog in Tkinter(Python). I try using askdirectory and askopenfilenames. But I can’t find a special dialog in documentation.
https://docs.python.org/3/library/dialog.html
This is my sample code:
The problem is that askopenfilenames and askdirectory don’t return a list with the files and the folders that I select.

Best Answer:

By default, the askopenfilenames and askdirectory functions return only the file paths or directory path respectively, and not both in a single call.
askopenfilenames and askdirectory both return tuples, which is why we convert them to lists before concatenating them.

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com

filedialog python tkinter
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How to stop a thread that has a blocking function from easygui in python

05/04/2023

Resolved: Removing null keys from a json array of objects

05/04/2023

Resolved: How can I generate at compile-time a separate OpenAPI Swagger.json file for each Controller in my ASP.NET project?

05/04/2023

Comments are closed.

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.