By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,011 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

HELP! Keep getting invalid syntax message

P: 1
HELP! Keep getting invalid syntex message
Expand|Select|Wrap|Line Numbers
  1. from tkinter import *
  3. class MyFrame(Frame):
  4.     def__init__(self):
  5.         Frame.__init__(self)
  7.         self.myCanvas = Canvas(width=300, height=200, bg="blue")
  8.         self.myCanvas.grid()
  10. #now create a MyFrame object and call on main loop
  11. frame02 = MyFrame()
  12. frame02.mainloop()
2 Weeks Ago #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 5,387
should be
Expand|Select|Wrap|Line Numbers
  1.     def __init__(self):
  2.        ^space between def and __init
2 Weeks Ago #2

Post your reply

Sign in to post your reply or Sign up for a free account.