Tkinter unable to alloc 71867 bytes
Question: so, I am playing with GUI and with Tkinter, I was trying to make a notepad in
python.

my code so far:

    
    
    from Tkinter import *
    def hello():
        print "hello!"
    
    ventana = Tk()
    
    barra_menu=Menu(ventana)
    barra_menu.add_command(label="Archivos")
    barra_menu.add_cascade(label="Guardar", menu =barra_menu)
    
    ventana.config(menu=barra_menu)
    
    notepad =Text()
    notepad.pack()
    ventana.mainloop()
    

and when I run the script this error shows up:

    
    
    unable to alloc 71867 bytes
    
    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.
    


Answer: I'm not sure what you want to achieve but it looks like this line

    
    
    barra_menu.add_cascade(label="Guardar", menu =barra_menu)
    

is creating an infinite loop, as it is using itself as a parameter. The loop
presumably ends when your system runs out of memory and hence the error.

An immediate fix is to remove the `menu` parameter. If you want a menu
attached to that button use a different menu.

