Python- Changing from pack() to .grid() results in AttributeError: 'NoneType' object has no attribute 'get'

前端 未结 1 1599
温柔的废话
温柔的废话 2021-01-27 13:39

While developing a tkinter interface for a small encryption program I switched it from .pack(), which I only used while beginning to write out the buttons e.g., to .grid(). Prev

1条回答
  •  自闭症患者
    2021-01-27 14:25

    In tkinter, Widget.pack and Widget.grid both return None. So, Input_Box's value is None. You want to create and grid your widget on separate lines.

    Input_Box = Entry(root, bg="grey")
    Input_Box.grid(row=0, column=0)
    

    0 讨论(0)
提交回复
热议问题