File: select_file.py

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

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

app = App()

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

app.display()