hi everyone i wanna create a class in tkinter but im finding it very difficult to begin it as im new to python. i want a class traffic light that will operate continuously (that is red to green to red.... ). thanks..
harrykokil
0
Light Poster
Recommended Answers
Jump to PostThis would be a typical Tkinter class creating what looks like a traffic light. I leave it up to you to assign the proper light actions.
# a simple Tkinter class import Tkinter as tk class TrafficLight(tk.Frame): """inherits tk.Frame""" def __init__(self, parent=None): tk.Frame.__init__(self, parent, bg='green') self.grid() # …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.