nltk.in_idle()

nltk.in_idle()[source]

Return True if this function is run within idle. Tkinter programs that are run in idle should never call Tk.mainloop; so this function should be used to gate all calls to Tk.mainloop.

Warning:This function works by checking sys.stdin. If the user has modified sys.stdin, then it may return incorrect results.
Return type:bool