from Tkinter import * import tkMessageBox def a(): tkMessageBox.showwarning("Open file", "Cannot open this file\n") a()