from Tkinter import *
from random import randrange

class Pole(Canvas):
    def __init__(self,rows,cols,size):
        self.rows=rows
        self.cols=cols
        self.size=size
        width_g=cols*size
        height_g=rows*size
        Canvas.__init__(self,relief=RIDGE, borderwidth=2, width=width_g, height=height_g)
        A=range(rows+1)
        for i in range(rows):
            A[i]=range(cols)
        for i in range(rows):
            for j in range(cols):
                A[i][j]=0
                x=j*size
                y=i*size
                x1=x+size
                y1=y+size
                self.create_rectangle(x,y,x1,y1, fill=colors[0],tag='pole')
        self.data=A
    def ris(self):
        for i in range(self.rows):
            for j in range(self.cols):
                x=j*self.size
                y=i*self.size
                x1=x+self.size
                self.create_rectangle(x,y,x1,y1, fill=colors[self.data[i][j]],tag='pole')
class Work:
    def __init__(self,rows=30,cols=15,size=15,delay=1000):
        self.ii=2
        self.jj=cols/2
        self.nf=1
        self.nf=randrange(len())
    for nk in [0,1,2,3]:
        x=(self.jj+fig_data[self.nf][nk][1])*size
        y=(self.ii+fig_data[self.nf][nk][0])*size
        x1=x+size
        y1=y+size
        pole.create_rectangle(x,y,x1,y1, fill=fig_data[self.nf][nk])
          
    fig_data[self.nf]

def ris(self):
    for nk in [0,1,2,3]:
        s=(self.jj+self.B[nk][1])*self.size
        y=(self.ii+self.B[nk][0])*self.size
        x1=x+self.size
        y1=y+self.size
        pole.create_rectangle(x,y,x1,y1 fill=colors[self.B[4]],tag='cubs')

def move(self,i,j,):
    a=o
    for nk in 0,1,2,3:
        iii=self.ii+self.B[nk][0]
        jjj=self.jj+self.B[nk][1]
        if iii in range(pole.rows) and jjj in range(pole.cols)and pole.data[]
#def f_top_top(event):
    #print'ryaaaaa!!!'

def keyPressed(event):
    if(event.keysym == "Up"):
        pass
    if(event.keysym == "Down"):
        pass
    if(event.keysym == "Left"):
        try:
            figa.jj-=1
            figa.jj.top_top()
        except Tupik:
            figa.jj+=1
    if(event.keysym == "Right"):
        pass
    elif (event.char == "g"):
        time_top()
          
okno=Tk()
okno.title('Tetris')

ramka_1 =Frame(okno, relief=SOLID, borderwidth=3, width=300, height=600, bg='#9ACD32')
ramka_2 =Frame(okno, width=300,bg='white')

ramka_1.pack(side=LEFT)
ramka_2.pack(side=LEFT, fill=BOTH)

ramka_t=Frame(ramka_2, relief=GROOVE, borderwidth=3, width=250, height=100,bg='#FF69B4')
ramka_t.pack(side=TOP)
ramka_B=Frame(ramka_2, width=250, height=100,bg='#B22222')
ramka_B.pack(side=BOTTOM)

pole=Pole(ramka_1,rows=18, cols=12, bit=20,color='#808080')
pole.pack(side=LEFT, expand=1)

figa=Figa(15,15)

okno.bind("<Key>", KeyPressed)

#exort.create_oval(0,100,70,70, fill='deepskyblue')

but={}

but[1]=Button(ramka_B,text='START',command=my_start)
but[2]=Button(ramka_B,text='EXIT',command=okno.destroy)
but[3]=Button(ramka_B,text='CLEAR',command=my_clear)
but[4]=Button(ramka_B,text='COLOR',command=my_color)

but[1].grid(row=0, column=0)
but[2].grid(row=0, column=1)
but[3].grid(row=1, column=0)
but[4].grid(row=1, column=1)

okno.mainloop()