How to access all Harddrives in kivy FileChooser Python

Question:

how can I display all harddrives installed in the System (C,X,J) in a kivy FileChooser using either Listview or Iconview in kivy 1.11.1?

Asked By: The Dev

||

Answers:

I faced the same problem and finally solved it by adding "shortcut" buttons for the drives. I start by getting a list of all the drives using:

drives = ['%s:' % d for d in string.ascii_uppercase if os.path.exists('%s:' % d)]

Then creating a Button for each drive, with the on_release bound to an open_entry() method. The open_entry() method creates a fake Entry and calls the FileChooser open_entry() method.

Answered By: John Anderson

The best solution I found is Kivy’s Garden FileBrowser widget:

https://github.com/kivy-garden/garden.filebrowser

Which produces the following layout:

enter image description here

Answered By: kelkka
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.