#!/usr/bin/env python
from Tkinter import *

winopen = 0

class Window(Toplevel):
    def __init__(self, master, **kw):
        global winopen
        apply(Toplevel.__init__, (self, master), kw)
        winopen = 1
    def __del__(self):
        global winopen
        winopen = 0

def newwin():
    if not winopen:
        window = Window(root)
        Label(window, text = "I'm unique!").pack()

root = Tk()
Button(root, text="Window", command = newwin).pack()
root.mainloop()
