def asksaveasfile(mode='w', **options):
 filename = SaveAs(**options).show()
 if filename:
  return open(filename, mode)
 return None

def asksaveasfile ( mode = 'w' , ** options ) : filename = SaveAs ( ** options ) . show ( ) if filename : return open ( filename , mode ) return None
ask for a filename to save as .