0

Hello everyone!

I am tring to use Tkinter from terminal (I'm on a mac) and I keep raising AttributeErrors on both Python 2.7 and Python 3. For 2.7 I input:

from Tkinter import *
win = Tk()
f = Frame(win)
b1 = Button(f, "One")

and I raise the AttributeError: 'str' object has no attribute 'keys'

And for Python3 I try:

from tkinter import *
win = Tk()
f = Frame(win)
b1 = Button(f, "One")

and I raise the AttributeError: 'str' object has no attribute 'items'.

Any thoughts on it? I've searched around but found nothing so far, still searching however as I type this. ^.^

2
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by clouds_n_things
2

Take a look at the first code example Click Here especially how text is assigned so it appears on the button.

Edited by woooee

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.