I was trying out a python code example at Rosetta Code - a programming chrestomathy site, where solutions to the same task are presented in as many different programming languag
The error message is telling you that the dialog needs a parent window.
With Python 2.x, you create the root window with:
import tkinter from tkinter import simpledialog root = tkinter.Tk()
To hide the root window if you don't want it, use:
root.withdraw()
See the Python Tkinter Docs for more info.