def OnSave(self,event): # Save away the edited text # Open the file, do an RU sure check for an overwrite! dlg = wx.FileDialog(self, "Save JSON file", "", "", "JSON files (*.json)|*.json", wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT) if dlg.ShowModal() == wx.ID_OK: # Open the file for write, write, close filename=dlg.GetFilename() dirname=dlg.GetDirectory() f= dirname + '/' + filename BN.save(f) # Get rid of the dialog to keep things tidy dlg.Destroy()
def OnSave(self, event): # Save away the edited text # Open the file, do an RU sure check for an overwrite! dlg = wx.FileDialog(self, "Save JSON file", "", "", "JSON files (*.json)|*.json", wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT) if dlg.ShowModal() == wx.ID_OK: # Open the file for write, write, close filename = dlg.GetFilename() dirname = dlg.GetDirectory() f = dirname + '/' + filename BN.save(f) # Get rid of the dialog to keep things tidy dlg.Destroy()