0
Can anyone tell me why this program is not running?
from tkinter import * from random import * def bgg(event): a=randint(0,6) a2=randint(0,6) fr2=frame().grid() colors=(''red'',''orange'',''blue'',''indigo'',''orange'',''violet'',''green'') col=colors[a] col2=colors[a2] fr=frame(r,width=720,height=1300,bg=col) fr.bind(''<button-1>'',bgg) fr.grid(row=0,column=0) label(fr2,text=''Hello World'',bg=col,fg=col2).grid(row=0,column=0) r=Tk() col=''red'' fr=frame(r,width=720,height=1300,bg=col) fr.bind(''<button-1>'',bgg) fr.grid(row=0,column=0) r.mainloop()
3 Réponses
+ 4
Akshay Sonar are you sure it is not an IndentationError ?
The only thing I see is that it is not aligned with the other statements. You need to add a space at the beginning of the line.
+ 2
Can you tell us what error you get ?
0
Aymane Boukrouh [INACTIVE]
It says syntax error on line 7