tkinter - Zelle Graphics Error Python -
i have been trying import zelle's graphics library python while keep getting error short program created. traceback (most recent call last): file "d:\my_stuff\desktop\connectfour.py", line 5, in <module> graphics import* file "c:\python33\lib\site-packages\graphics.py", line 1, in <module> class graphwin(tk.canvas): nameerror: name 'tk' not defined
here program in case:
from graphics import* def main(): win = graphwin("connect four", 320, 240) win.setbackround("white") win.setcoords(0,0,7,6) board = rectangle((0,0),(7,6)) board.draw(win) (tk.canvas) main()
i believe error relates tkinter library (which have). , person said fix code indentation: i'm new (^) better?
several small problems code:
1) line 4: should win.setbackground (probably typo)
2) line 6: rectangle's arguments must point objects, e.g. rectangle(point(0,0), point(7,6))
3) line 8: there no need line, zelle's graphics module takes care of tkinter semantics in background.
4) error seems suggest graphics module not loading tkinter correctly. if have been messing module code, may easiest download module again rather try fix it.
Comments
Post a Comment