1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| # !/usr/bin/env python 3.5
# -*- coding: utf-8 -*-
from tkinter import *
class Gammic(Tk):
def __init__(self):
Tk.__init__(self)
self.title(' :')
self.ccc = None
self.a = Button(self, text='Comic', width=15, command=self.Comic)
self.a.pack()
self.table = []
self.com2 = Gam2()
def cb_com2(self):
self.com2.brnch(self.table)
def Comic(self):
if self.ccc is not None:
self.ccc.destroy()
self.ccc = Toplevel(self)
self.ccc.geometry('600x666')
self.b = Button(self.ccc, text='Comic2', width=15,
command = self.cb_com2)
self.b.pack()
for i in range(10):
self.table.append(i)
class Gam2(Gammic):
def __init__(self):
pass
def brnch(self, cob):
print('ooo', cob)
Gammic().mainloop() |