Click here to Skip to main content
15,031,208 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Python
topFrame=Frame(root)
topFrame.pack()
bottomFrame=Frame(root)
bottomFrame.pack(side=BOTTOM)

one=Label(root, text="one", bg="black", fg="white")
two=Label(root, text="Two", bg="white", fg="black")
three=Label(root, text="three", fg="purple", bg="green")
one.pack()
two.pack(fill=X)
three.pack(side=LEFT, fill=Y

button1=Button(topFrame, text="Button1", fg="red")
button2=Button(topFrame, text="Button2", fg="green")
button3=Button(topFrame, text="Button3", fg="blue")
button4=Button(bottomFrame, text="Button4", fg="purple")


button1.pack(side=LEFT)
button2.pack(side=LEFT)
button3.pack(side=LEFT)
button4.pack(side=BOTTOM)



root.mainloop()


Why does line 13 give an error, "Invalid Syntax"?
Line 13 is:
button1=Button(topFrame, text="Button1", fg="red")
Posted
Updated 10-Mar-15 17:51pm
v3

1 solution

Because line 11 is incomplete:
Python
three.pack(side=LEFT, fill=Y

It needs a closing parenthesis.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900