def asktosave(root):
s = tkMessageBox.askyesnocancel('Unsaved Packets...',
'Do You Want to Save Your Packets?\n If You Won\'t, They\'ll be Really Sad',
parent=root)
if not s: return s # s can be None (for 'Cancel') or False (for 'No')
filename = tkFileDialog.asksaveasfilename(title='Save As',
parent=root,
filetypes=[('cablefish files', '.cf'), ('all files', '.*')],
initialdir='C:/Users/',
defaultextension='.cf'
)
return filename
评论列表
文章目录