human
Can you provide a code to 4 Queue 模块 and the other steps required given the following:
4 Queue 模块
使用Queue结构来共享线程之间的数据
函数 | 描述 
--- | --- 
queue(size) | 构造函数
qsize() | 返回队列的大小
empty() | 是否为空
full() | 是否满 
put(item, block=0) | 把item放入到队列中，如果block不为0，函数阻塞到队列中有空间为止 
get(block=0) | 从队列中获取对象，如果block中不为0，函数阻塞只队列中有对象"
Please write code following the instructions in jupyter notebook style.
assistant
#Here is code to 4 Queue 模块 and the other steps required.

from random import randint
from time import sleep
from Queue import Queue
import threading
class MyThread(threading.Thread):
    def __init__(self, func, args, name =''):
        threading.Thread.__init__(self)
        self.name = name
        self.func = func
        self.args = args
    def getResult(self):
        return self.result
    def run(self):
        print 'starting', self.name, 'at: ', ctime()
        self.result = apply(self.func, self.args)
        print self.name, 'finished at: ', ctime()
def writeQ(queue):
    print 'producting object for Q...',queue.put('xxx', 1)
    print 'size now', queue.qsize()
def readQ(queue):
    val = queue.get(1)
    print 'consumed object from Q...', queue.qsize()
def writer(queue, loops):
    for i in range(loops):
        writeQ(queue)
        sleep(randint(1, 3))
def reader(queue, loops):
    for i in range(loops):
        readQ(queue)
        sleep(randint(2, 5))
funcs = [writer, reader]
nfuncs = range(len(funcs))
def main():
    nloops = randint(2,5)
    q = Queue(32)
    threads = []
    for i in nfuncs:
        t= MyThread(funcs[i], (q, nloops), funcs[i].__name__)
        threads.append(t)
    for i in nfuncs:
        threads[i].start()
    for i in nfuncs:
        threads[i].join()
    print 'all Done'
main()

import Tkinter
top = Tkinter.Tk()
hello = Tkinter.Label(top, text = 'hello world!')
hello.pack()
quit = Tkinter.Button(top, text='quit', command=top.quit, bg='red', fg='white')
quit.pack(fill = Tkinter.X, expand=1)
Tkinter.mainloop()