can u plz debug it for me?? thanks

import Tkinter as tk
import time
import sys
import datetime as dt 
from Tkinter import *


root=tk.Tk()
root.title("Traffic Simulation")
canvas = tk.Canvas(root, width=1000, height=400, bg="#FFFFFF")

canvas.pack()



for x in range (1,10):
    print 'orange'+x

canvas.update()

root.mainloop()

You mean something like this?

import Tkinter as tk
import time
import sys
import datetime as dt 


root = tk.Tk()
root.title("Traffic Simulation")

canvas = tk.Canvas(root, width=1000, height=400, bg="#FFFFFF")
canvas.pack()

for k in range (1,10):
    s = 'orange' + str(k)
    x = k * 50
    y = 20
    canvas.create_text(x, y, text=s)

canvas.update()

root.mainloop()

thats exactly wat i needed.. thanks...

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.