from wxPython.wx import * class MiaApp(wxApp): def OnInit(self): dlg = wxFileDialog(None, "Scegli un file", ".", "nome file di default.txt", "File di testo (*.txt)|*.txt|Tutti i file|*.*", wxOPEN) if dlg.ShowModal() == wxID_OK: wxMessageBox("Il file scelto è " + dlg.GetFilename() + "\nIl percorso completo è " + dlg.GetPath()) # Ricordatevi sempre di distruggere la finestra! dlg.Destroy() return 1 app = MiaApp() app.MainLoop()