File: select_file.py

package info (click to toggle)
python-guizero 1.4.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,828 kB
  • sloc: python: 6,744; makefile: 28; sh: 17
file content (13 lines) | stat: -rw-r--r-- 356 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
from guizero import App, PushButton, Text, CheckBox

def get_file():
    file_returned = app.select_file(filetypes=[["All files", "*.*"], ["Text documents", "*.txt"]], save=save.value)
    file_name.value = file_returned

app = App()

save = CheckBox(app, text="save")
PushButton(app, command=get_file, text="Get file")
file_name = Text(app)

app.display()