The GTK framework has "FileChooserDialog" which is a complete window for navigating the file system, and allows either the choice of an existing file (or directory) ("open" action), or the user type a new name ("save" action).
Since your question, unlike the practices indicated, does not have anything of your code, I also have no way to give an example of use (without writing an entire, functional program).
The FileChooser documentation, as used by Python is here:
link
Basically, the call to create the dialog is:
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk as gtk
...
dialog = gtk.FileChooserDialog(
title="Please choose a file", window=sua_janela_principal_,
action=gtk.FileChooserAction.OPEN,
buttons=(gtk.STOCK_CANCEL, gtk.ResponseType.CANCEL,
gtk.STOCK_OPEN, gtk.ResponseType.OK))
)
After you build the dialog and configure the desired parameters, call the run
method: the current thread of your program pauses while the dialog is used by the user - after it chooses and confirms a file, check name chosen by calling:
nome = dialog.get_filename()
dialog.destroy()
In the above url there is a complete program using the dialog in more detail (what to do in case the user cancels the action, for example)