Python ÓÎÏ·³õѧ
import sys, pygame, time
size = width, height = 700,700
fontColor = (0,0,255)
class walk:
'''This is a game about war.
Just like war 3.'''
def __init__(self):
'''Init the screen.
Get param and init the screen'''
#print ('this is init funnction')
def initMainGraph(self):
print ('¤³¤³¤Ç¥á¥ó»Ãæ¤ò³õÆÚ»¯')
def outputChar(self, screen, imgRect):
oc = pygame.font.SysFont('Arial', 36)
str = 'Let\'s Start the Game'
wid = 100
hei = 300
for i in str:
surf = oc.render(i,0,fontColor)
rec = surf.get_rect()
wid += 20
rec.topleft = (wid, hei)
screen.blit(surf,rec)
pygame.display.flip()
time.sleep(0.25)
def slow(self, screen, imgRect):
print ('slow show')
def runGame():
pygame.init()
screen = pygame.display.set_mode(size)
bgimg = pygame.image.load('world.png').convert_alpha()#load bgImage
imgRect = bgimg.get_rect() #get the Area of the Image
screen.blit(bgimg,imgRect)
pygame.display.flip()
luxs = walk() #create a object
luxs.outputChar(screen, imgRect)
time.sleep(3)
while 1:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit(0)
runGame()
³õѧÕߣ¬×öÁËÒ»¸öСÀý×Ó£¬ÏÔʾ±³¾°Í¼ºÍÎı¾
Ïà¹ØÎĵµ£º
ת×Ô http://www.javaeye.com/topic/561786
ÔÌû£ºhttp://www.cnblogs.com/jingleguo/archive/2008/06/02/1211820.html
µ±pythonÖм䴦Àí·ÇASCII±àÂëʱ£¬¾³£»á³öÏÖÈçÏ´íÎó£º
UnicodeDecodeError: 'ascii' codec can't decode byte 0x?? in position 1: ordinal not in range(128)
0x??Êdz¬³ö128µÄÊý×Ö£¬pythonÔÚĬÈϵ ......
[root@pku-fan MySQL]# cat limbs.sql
CREATE DATABASE cookbook;
USE cookbook;
DROP TABLE IF EXISTS limbs;
CREATE TABLE limbs
(
thing VARCHAR(20), # what the thing is
legs INT, ......
2007-08-22 22:46
Ò»¡¢ÓÃSOAPpy·ÃÎÊdotnet webservice
dotnetµÄwebservice
<WebMethod()> _
Public Function HelloWorld() As String
Return "H ......
ʹÓÃpython.vimʹpython´úÂë¸ßÁÁ
http://www.vim.org/scripts/script.php?script_id=790
ʹÓÃ
Pydiction²å¼þʹvimÔö¼Ótab´úÂëÌáʾ¹¦ÄÜ
http://www.vim.org/scripts/script.php?script_id=850
¾ßÌå°²×°·½·¨¿ÉÒÔ²ÎÕÕ°ïÖú»òÕßREADME£¬ÒòΪ°æ±¾±ä»¯»áµ¼Ö°²×°·½·¨ÉϲúÉú²îÒì
±à¼~/.vimrcÎļþÔö¼ÓÏÂÃæÑ¡Ïî
set nu Ôö¼ÓÐÐ ......
int main()
{
int a[] = {1,2,3,4,5};
int i;
int * p = a;
for (p = a + 4, i = 0; i < 5; i++) {
printf("%d ",p[-i]);
}
return 0;
}
......