Python2.7でTetrisを作ろうと思い、Tkinterとwxpythonを使用し、以下の一連の動作をしたいのですが
実行したら初めて見る長いエラーが出てきました。、
エラーの意味が全くわかりません。どうか原因を教えてください。
Tkinterでスタート画面を作る → STARTをクリック→ Tkinterでwindowを作成 → wxpythonでwindowを
新しく作成 → テトリスが始まる
python2.7
Tkinter
wxpthon4.0
#!/usr/bin/python # -*- coding: utf-8 -*- import wx import random import sys import Tkinter class Menu: def __init__(self): self.tkinter() def start(self): self.tetris.frame() root.destroy() def quit(self): wx.Exit() def tkinter(self): tetris = Tetris() root = Tkinter.Tk() self.root.title(u"TETRIS") self.root.geometry("425x850") #ラベル Static1 = Tkinter.Label(text=u'TETRIS') Static1.pack() #ボタン Button1 = Tkinter.Button(text=u'START', width = 100) Button1.bind("<Button-1>", start) Button1.place(x = 125, y = 60) Button2 = Tkinter.Button(text=u'QUIT', width = 100) Button2.bind("<Button-1 >", quit) Button2.place(x = 125, y = 120) center(root) root.mainloop() # 枠組み作り class Tetris: def frame(self): frame = wx.Frame(None, wx.ID_ANY, title = 'TETRIS') self.initFrame() def initFrame(self): self.statusbar = self.CreateStatusBar() # ステータスバーの作成 self.statusbar.SetStatusText('0') # ステータスバーに 0 を表示 self.board = Board(self) # Boardクラスのインスタンスオブジェクト self.board.start() # Boardクラスのメソッドstart self.Centre() # 中央に画面を置く self.Show(True) : : 略 : app = wx.App() Menu() #Tetris(None, title = 'TETRIS') app.MainLoop()
あなたの回答
tips
プレビュー