¶íÂÞ˹·½¿éÓÎÏ·£¬Ê¹ÓÃPythonʵÏÖ£¬×ܹ²ÓÐ350+ÐдúÂ룬ʵÏÖÁ˶íÂÞ˹·½¿éÓÎÏ·µÄ»ù±¾¹¦ÄÜ£¬Í¬Ê±»á¼Ç¼Ëù»¨·Ñʱ¼ä£¬ÏûÈ¥µÄ×ÜÐÐÊý£¬ËùµÃµÄ×Ü·Ö£¬»¹°üÀ¨Ò»¸öÅÅÐаñ£¬¿ÉÒԲ鿴×î¸ß¼Ç¼¡£
ÅÅÐаñÖаüº¬Ò»ÏµÁеÄͳ¼Æ¹¦ÄÜ£¬È絥λʱ¼äÏûÈ¥µÄÐÐÊý£¬µ¥Î»Ê±¼äµÃ·ÖµÈ¡£
¸½Ô´Â룺
from Tkinter import *
from tkMessageBox import *
import random
import time
#¶íÂÞ˹·½¿é½çÃæµÄ¸ß¶È
HEIGHT = 18
#¶íÂÞ˹·½¿é½çÃæµÄ¿í¶È
WIDTH = 10
ACTIVE = 1
PASSIVE = 0
TRUE = 1
FALSE = 0
root=Tk();root.title('Russia')
class App(Frame):
def __init__(self,master):
Frame.__init__(self)
master.bind('<Up>',self.Up)
master.bind('<Left>',self.Left)
master.bind('<Right>',self.Right)
master.bind('<Down>',self.Down)
#master.bind('<Down>',self.Space)
master.bind('<space>',self.Space)
master.bind('<Control-Shift-Key-F12>',self.Play)
master.bind('<Key-F6>',self.Pause)
self.backg="#%02x%02x%02x" % (120,150,30)
self.frontg="#%02x%02x%02x" % (40,120,150)
self.nextg="#%02x%02x%02x" % (150,100,100)
self.flashg="#%02x%02x%02x" % (210,130,100)
self.LineDisplay=Label(master,text='Lines: ',bg='black',fg='red')
self.Line=Label(master,text='0',bg='black',fg='red')
self.ScoreDisplay=Label(master,text='Score: ',bg='black',fg='red')
self.Score=Label(master,text='0',bg='black',fg='red')
#Display time
self.SpendTimeDisplay=Label(master,text='Time: ',bg='black',fg='red')
self.SpendTime=Label(master,text='0.0',bg='black',fg='red')
self.LineDisplay.grid(row=HEIGHT-2,column=WIDTH,columnspan=2)
self.Line.grid(row=HEIGHT-2,column=WIDTH+2,columnspan=3)
self.ScoreDisplay.grid(row=HEIGHT-1,column=WIDTH,columnspan=2)
self.Score.grid(row=HEIGHT-1,column=WIDTH+2,columnspan=3)
#Display time
self.SpendTimeDisplay.grid(row=HEIGHT-4,column=WIDTH,columnspan=2)
1. 9.7 ÕýÔò±í´ïʽÓë re Ä£¿é
Ò»¸öÕýÔò±í´ïʽ¾ÍÊÇÒ»¸öÓÃÀ´±íʾijÖÖģʽµÄ×Ö·û´®¡£ËüÄÜ°ïÖúÄã·½±ãµÄ¼ì²éÒ»¸ö×Ö·û´®ÊÇ·ñÓëijÖÖģʽƥÅä¡£
re Ä£¿éʹ Python ÓïÑÔÓµÓÐÈ«²¿µÄÕýÔò±í´ïʽ¹¦ÄÜ¡£ compile º¯Êý¸ù¾ÝÒ»¸öģʽ×Ö·û´®ºÍ¿ÉÑ¡µÄ±êÖ¾²ÎÊýÉú³ÉÒ»¸öÕýÔò±í´ïʽ¶ÔÏ󡣸öÔÏóÓµÓÐһϵÁз½·¨ÓÃÓÚÕýÔò±í´ïʽƥÅäºÍÌæ»»¡£ re Ä£ ......
windowsϵķ¾¶Ïñ“f:\program files\python\backup”ÆäÖГ\”ÐèÒªÓÃתÒå·û£¬Ð´³É“\\”£¬»òÕßÇ°Ãæ¼Órд³Épath
= r’f:\program files\python\backup’µ«ÊÇÔÚµ÷ÓÃһЩϵͳÃüÁÈços.system(rar a path e:\backup)»á³ö´í£¬ÔÒòÊÇ“program files&rdquo ......