我创建一个Tkinter的程序,并遇到了这个奇怪的错误。 这里是我的代码:
from Tkinter import *
def get_info(key):
pass
def create_new():
create = Toplevel(root)
create.title('Create A New Contact')
Label(create, text='Name: ').grid(row=0, sticky=W+E)
name = Entry(create, width=8).grid(row=1, sticky=W+E)
Label(create, text='Address(ex. 1111 Main St, MyCity, Anystate 12345): ', wrapLength=1).grid(row=2, sticky=W+E)
address = Entry(create, width=8).grid(row=3, sticky=W+E)
def access():
access_window = Toplevel(root)
access_window.title("Access a Contact")
Label(access_window, text=“Enter a first name: ‘).grid(row=0, sticky=‘W+E’)#Error here
access_key = Entry(access_window, width=8).grid(row=0, sticky='W+E')
Button(access_window, text="Submit", command=lambda: get_info(access_key.get('0.0', 'end-1c'))).grid(row=2, sticky='W+E')
root = Tk()
root.title('Address Book')
button1 = Button(root, text="Create New", command=create_new).grid(row=0, column=0)
button2 = Button(root, text=“Access Person”, command=access).grid(row=0, column=1)
控制台说:
Error: EOL while scanning string literal.
我怎样才能解决这个问题?