user interface - cannot create frame using python simplegui -
for following code snippet:
import simplegui message = "welcome!" def click(): global message message = "good job!" def draw(canvas): canvas.draw_text(message, [50,112], 48, "red") frame = simplegui.create_frame("home", 300, 200) frame.add_button("click me", click) frame.set_draw_handler(draw) frame.start()
i'm getting error message on create_frame, "undefined variable import:create_frame". can tell me problem is? simplegui imported , code given reputed university website.
the problem you're running there 2 libraries called simplegui. the 1 on pypi (the 1 that's giving error) totally different the 1 codeskulptor (the 1 have example code). if want use codeskulptor's example code you'll have run code inside codeskulptor. if want run code on local computer you'll have abandon codeskulptor example code.
Comments
Post a Comment