python使用pygame框架实现推箱子游戏


Posted in Python onNovember 20, 2018

本代码来源于 《Python和Pygame游戏开发指南》中的 Star Pusher 游戏,供大家参考,具体内容如下

# Star Pusher (a Sokoban clone)
# By Al Sweigart al@inventwithpython.com
# http://inventwithpython.com/pygame
# Released under a "Simplified BSD" license
 
import random, sys, copy, os, pygame
from pygame.locals import *
 
FPS = 30 # frames per second to update the screen
WINWIDTH = 800 # width of the program's window, in pixels
WINHEIGHT = 600 # height in pixels
HALF_WINWIDTH = int(WINWIDTH / 2)
HALF_WINHEIGHT = int(WINHEIGHT / 2)
 
# The total width and height of each tile in pixels.
TILEWIDTH = 50
TILEHEIGHT = 85
TILEFLOORHEIGHT = 40
 
CAM_MOVE_SPEED = 5 # how many pixels per frame the camera moves
 
# The percentage of outdoor tiles that have additional
# decoration on them, such as a tree or rock.
OUTSIDE_DECORATION_PCT = 20
 
BRIGHTBLUE = ( 0, 170, 255)
WHITE = (255, 255, 255)
BGCOLOR = BRIGHTBLUE
TEXTCOLOR = WHITE
 
UP = 'up'
DOWN = 'down'
LEFT = 'left'
RIGHT = 'right'
 
 
def main():
 global FPSCLOCK, DISPLAYSURF, IMAGESDICT, TILEMAPPING, OUTSIDEDECOMAPPING, BASICFONT, PLAYERIMAGES, currentImage
 
 # Pygame initialization and basic set up of the global variables.
 pygame.init()
 FPSCLOCK = pygame.time.Clock()
 
 # Because the Surface object stored in DISPLAYSURF was returned
 # from the pygame.display.set_mode() function, this is the
 # Surface object that is drawn to the actual computer screen
 # when pygame.display.update() is called.
 DISPLAYSURF = pygame.display.set_mode((WINWIDTH, WINHEIGHT))
 
 pygame.display.set_caption('Star Pusher')
 BASICFONT = pygame.font.Font('freesansbold.ttf', 18)
 
 # A global dict value that will contain all the Pygame
 # Surface objects returned by pygame.image.load().
 IMAGESDICT = {'uncovered goal': pygame.image.load('RedSelector.png'),
   'covered goal': pygame.image.load('Selector.png'),
   'star': pygame.image.load('Star.png'),
   'corner': pygame.image.load('Wall_Block_Tall.png'),
   'wall': pygame.image.load('Wood_Block_Tall.png'),
   'inside floor': pygame.image.load('Plain_Block.png'),
   'outside floor': pygame.image.load('Grass_Block.png'),
   'title': pygame.image.load('star_title.png'),
   'solved': pygame.image.load('star_solved.png'),
   'princess': pygame.image.load('princess.png'),
   'boy': pygame.image.load('boy.png'),
   'catgirl': pygame.image.load('catgirl.png'),
   'horngirl': pygame.image.load('horngirl.png'),
   'pinkgirl': pygame.image.load('pinkgirl.png'),
   'rock': pygame.image.load('Rock.png'),
   'short tree': pygame.image.load('Tree_Short.png'),
   'tall tree': pygame.image.load('Tree_Tall.png'),
   'ugly tree': pygame.image.load('Tree_Ugly.png')}
 
 # These dict values are global, and map the character that appears
 # in the level file to the Surface object it represents.
 TILEMAPPING = {'x': IMAGESDICT['corner'],
   '#': IMAGESDICT['wall'],
   'o': IMAGESDICT['inside floor'],
   ' ': IMAGESDICT['outside floor']}
 OUTSIDEDECOMAPPING = {'1': IMAGESDICT['rock'],
    '2': IMAGESDICT['short tree'],
    '3': IMAGESDICT['tall tree'],
    '4': IMAGESDICT['ugly tree']}
 
 # PLAYERIMAGES is a list of all possible characters the player can be.
 # currentImage is the index of the player's current player image.
 currentImage = 0
 PLAYERIMAGES = [IMAGESDICT['princess'],
   IMAGESDICT['boy'],
   IMAGESDICT['catgirl'],
   IMAGESDICT['horngirl'],
   IMAGESDICT['pinkgirl']]
 
 startScreen() # show the title screen until the user presses a key
 
 # Read in the levels from the text file. See the readLevelsFile() for
 # details on the format of this file and how to make your own levels.
 levels = readLevelsFile('starPusherLevels.txt')
 currentLevelIndex = 0
 
 # The main game loop. This loop runs a single level, when the user
 # finishes that level, the next/previous level is loaded.
 while True: # main game loop
 # Run the level to actually start playing the game:
 result = runLevel(levels, currentLevelIndex)
 
 if result in ('solved', 'next'):
  # Go to the next level.
  currentLevelIndex += 1
  if currentLevelIndex >= len(levels):
  # If there are no more levels, go back to the first one.
  currentLevelIndex = 0
 elif result == 'back':
  # Go to the previous level.
  currentLevelIndex -= 1
  if currentLevelIndex < 0:
  # If there are no previous levels, go to the last one.
  currentLevelIndex = len(levels)-1
 elif result == 'reset':
  pass # Do nothing. Loop re-calls runLevel() to reset the level
 
 
def runLevel(levels, levelNum):
 global currentImage
 levelObj = levels[levelNum]
 mapObj = decorateMap(levelObj['mapObj'], levelObj['startState']['player'])
 gameStateObj = copy.deepcopy(levelObj['startState'])
 mapNeedsRedraw = True # set to True to call drawMap()
 levelSurf = BASICFONT.render('Level %s of %s' % (levelNum + 1, len(levels)), 1, TEXTCOLOR)
 levelRect = levelSurf.get_rect()
 levelRect.bottomleft = (20, WINHEIGHT - 35)
 mapWidth = len(mapObj) * TILEWIDTH
 mapHeight = (len(mapObj[0]) - 1) * TILEFLOORHEIGHT + TILEHEIGHT
 MAX_CAM_X_PAN = abs(HALF_WINHEIGHT - int(mapHeight / 2)) + TILEWIDTH
 MAX_CAM_Y_PAN = abs(HALF_WINWIDTH - int(mapWidth / 2)) + TILEHEIGHT
 
 levelIsComplete = False
 # Track how much the camera has moved:
 cameraOffsetX = 0
 cameraOffsetY = 0
 # Track if the keys to move the camera are being held down:
 cameraUp = False
 cameraDown = False
 cameraLeft = False
 cameraRight = False
 
 while True: # main game loop
 # Reset these variables:
 playerMoveTo = None
 keyPressed = False
 
 for event in pygame.event.get(): # event handling loop
  if event.type == QUIT:
  # Player clicked the "X" at the corner of the window.
  terminate()
 
  elif event.type == KEYDOWN:
  # Handle key presses
  keyPressed = True
  if event.key == K_LEFT:
   playerMoveTo = LEFT
  elif event.key == K_RIGHT:
   playerMoveTo = RIGHT
  elif event.key == K_UP:
   playerMoveTo = UP
  elif event.key == K_DOWN:
   playerMoveTo = DOWN
 
  # Set the camera move mode.
  elif event.key == K_a:
   cameraLeft = True
  elif event.key == K_d:
   cameraRight = True
  elif event.key == K_w:
   cameraUp = True
  elif event.key == K_s:
   cameraDown = True
 
  elif event.key == K_n:
   return 'next'
  elif event.key == K_b:
   return 'back'
 
  elif event.key == K_ESCAPE:
   terminate() # Esc key quits.
  elif event.key == K_BACKSPACE:
   return 'reset' # Reset the level.
  elif event.key == K_p:
   # Change the player image to the next one.
   currentImage += 1
   if currentImage >= len(PLAYERIMAGES):
   # After the last player image, use the first one.
   currentImage = 0
   mapNeedsRedraw = True
 
  elif event.type == KEYUP:
  # Unset the camera move mode.
  if event.key == K_a:
   cameraLeft = False
  elif event.key == K_d:
   cameraRight = False
  elif event.key == K_w:
   cameraUp = False
  elif event.key == K_s:
   cameraDown = False
 
 if playerMoveTo != None and not levelIsComplete:
  # If the player pushed a key to move, make the move
  # (if possible) and push any stars that are pushable.
  moved = makeMove(mapObj, gameStateObj, playerMoveTo)
 
  if moved:
  # increment the step counter.
  gameStateObj['stepCounter'] += 1
  mapNeedsRedraw = True
 
  if isLevelFinished(levelObj, gameStateObj):
  # level is solved, we should show the "Solved!" image.
  levelIsComplete = True
  keyPressed = False
 
 DISPLAYSURF.fill(BGCOLOR)
 
 if mapNeedsRedraw:
  mapSurf = drawMap(mapObj, gameStateObj, levelObj['goals'])
  mapNeedsRedraw = False
 
 if cameraUp and cameraOffsetY < MAX_CAM_X_PAN:
  cameraOffsetY += CAM_MOVE_SPEED
 elif cameraDown and cameraOffsetY > -MAX_CAM_X_PAN:
  cameraOffsetY -= CAM_MOVE_SPEED
 if cameraLeft and cameraOffsetX < MAX_CAM_Y_PAN:
  cameraOffsetX += CAM_MOVE_SPEED
 elif cameraRight and cameraOffsetX > -MAX_CAM_Y_PAN:
  cameraOffsetX -= CAM_MOVE_SPEED
 
 # Adjust mapSurf's Rect object based on the camera offset.
 mapSurfRect = mapSurf.get_rect()
 mapSurfRect.center = (HALF_WINWIDTH + cameraOffsetX, HALF_WINHEIGHT + cameraOffsetY)
 
 # Draw mapSurf to the DISPLAYSURF Surface object.
 DISPLAYSURF.blit(mapSurf, mapSurfRect)
 
 DISPLAYSURF.blit(levelSurf, levelRect)
 stepSurf = BASICFONT.render('Steps: %s' % (gameStateObj['stepCounter']), 1, TEXTCOLOR)
 stepRect = stepSurf.get_rect()
 stepRect.bottomleft = (20, WINHEIGHT - 10)
 DISPLAYSURF.blit(stepSurf, stepRect)
 
 if levelIsComplete:
  # is solved, show the "Solved!" image until the player
  # has pressed a key.
  solvedRect = IMAGESDICT['solved'].get_rect()
  solvedRect.center = (HALF_WINWIDTH, HALF_WINHEIGHT)
  DISPLAYSURF.blit(IMAGESDICT['solved'], solvedRect)
 
  if keyPressed:
  return 'solved'
 
 pygame.display.update() # draw DISPLAYSURF to the screen.
 FPSCLOCK.tick()
 
 
def isWall(mapObj, x, y):
 """Returns True if the (x, y) position on
 the map is a wall, otherwise return False."""
 if x < 0 or x >= len(mapObj) or y < 0 or y >= len(mapObj[x]):
 return False # x and y aren't actually on the map.
 elif mapObj[x][y] in ('#', 'x'):
 return True # wall is blocking
 return False
 
 
def decorateMap(mapObj, startxy):
 """Makes a copy of the given map object and modifies it.
 Here is what is done to it:
 * Walls that are corners are turned into corner pieces.
 * The outside/inside floor tile distinction is made.
 * Tree/rock decorations are randomly added to the outside tiles.
 Returns the decorated map object."""
 
 startx, starty = startxy # Syntactic sugar
 
 # Copy the map object so we don't modify the original passed
 mapObjCopy = copy.deepcopy(mapObj)
 
 # Remove the non-wall characters from the map data
 for x in range(len(mapObjCopy)):
 for y in range(len(mapObjCopy[0])):
  if mapObjCopy[x][y] in ('$', '.', '@', '+', '*'):
  mapObjCopy[x][y] = ' '
 
 # Flood fill to determine inside/outside floor tiles.
 floodFill(mapObjCopy, startx, starty, ' ', 'o')
 
 # Convert the adjoined walls into corner tiles.
 for x in range(len(mapObjCopy)):
 for y in range(len(mapObjCopy[0])):
 
  if mapObjCopy[x][y] == '#':
  if (isWall(mapObjCopy, x, y-1) and isWall(mapObjCopy, x+1, y)) or \
   (isWall(mapObjCopy, x+1, y) and isWall(mapObjCopy, x, y+1)) or \
   (isWall(mapObjCopy, x, y+1) and isWall(mapObjCopy, x-1, y)) or \
   (isWall(mapObjCopy, x-1, y) and isWall(mapObjCopy, x, y-1)):
   mapObjCopy[x][y] = 'x'
 
  elif mapObjCopy[x][y] == ' ' and random.randint(0, 99) < OUTSIDE_DECORATION_PCT:
  mapObjCopy[x][y] = random.choice(list(OUTSIDEDECOMAPPING.keys()))
 
 return mapObjCopy
 
 
def isBlocked(mapObj, gameStateObj, x, y):
 """Returns True if the (x, y) position on the map is
 blocked by a wall or star, otherwise return False."""
 
 if isWall(mapObj, x, y):
 return True
 
 elif x < 0 or x >= len(mapObj) or y < 0 or y >= len(mapObj[x]):
 return True # x and y aren't actually on the map.
 
 elif (x, y) in gameStateObj['stars']:
 return True # a star is blocking
 
 return False
 
 
def makeMove(mapObj, gameStateObj, playerMoveTo):
 """Given a map and game state object, see if it is possible for the
 player to make the given move. If it is, then change the player's
 position (and the position of any pushed star). If not, do nothing.
 Returns True if the player moved, otherwise False."""
 
 # Make sure the player can move in the direction they want.
 playerx, playery = gameStateObj['player']
 
 # This variable is "syntactic sugar". Typing "stars" is more
 # readable than typing "gameStateObj['stars']" in our code.
 stars = gameStateObj['stars']
 
 # The code for handling each of the directions is so similar aside
 # from adding or subtracting 1 to the x/y coordinates. We can
 # simplify it by using the xOffset and yOffset variables.
 if playerMoveTo == UP:
 xOffset = 0
 yOffset = -1
 elif playerMoveTo == RIGHT:
 xOffset = 1
 yOffset = 0
 elif playerMoveTo == DOWN:
 xOffset = 0
 yOffset = 1
 elif playerMoveTo == LEFT:
 xOffset = -1
 yOffset = 0
 
 # See if the player can move in that direction.
 if isWall(mapObj, playerx + xOffset, playery + yOffset):
 return False
 else:
 if (playerx + xOffset, playery + yOffset) in stars:
  # There is a star in the way, see if the player can push it.
  if not isBlocked(mapObj, gameStateObj, playerx + (xOffset*2), playery + (yOffset*2)):
  # Move the star.
  ind = stars.index((playerx + xOffset, playery + yOffset))
  stars[ind] = (stars[ind][0] + xOffset, stars[ind][1] + yOffset)
  else:
  return False
 # Move the player upwards.
 gameStateObj['player'] = (playerx + xOffset, playery + yOffset)
 return True
 
 
def startScreen():
 """Display the start screen (which has the title and instructions)
 until the player presses a key. Returns None."""
 
 # Position the title image.
 titleRect = IMAGESDICT['title'].get_rect()
 topCoord = 50 # topCoord tracks where to position the top of the text
 titleRect.top = topCoord
 titleRect.centerx = HALF_WINWIDTH
 topCoord += titleRect.height
 
 # Unfortunately, Pygame's font & text system only shows one line at
 # a time, so we can't use strings with \n newline characters in them.
 # So we will use a list with each line in it.
 instructionText = ['Push the stars over the marks.',
   'Arrow keys to move, WASD for camera control, P to change character.',
   'Backspace to reset level, Esc to quit.',
   'N for next level, B to go back a level.']
 
 # Start with drawing a blank color to the entire window:
 DISPLAYSURF.fill(BGCOLOR)
 
 # Draw the title image to the window:
 DISPLAYSURF.blit(IMAGESDICT['title'], titleRect)
 
 # Position and draw the text.
 for i in range(len(instructionText)):
 instSurf = BASICFONT.render(instructionText[i], 1, TEXTCOLOR)
 instRect = instSurf.get_rect()
 topCoord += 10 # 10 pixels will go in between each line of text.
 instRect.top = topCoord
 instRect.centerx = HALF_WINWIDTH
 topCoord += instRect.height # Adjust for the height of the line.
 DISPLAYSURF.blit(instSurf, instRect)
 
 while True: # Main loop for the start screen.
 for event in pygame.event.get():
  if event.type == QUIT:
  terminate()
  elif event.type == KEYDOWN:
  if event.key == K_ESCAPE:
   terminate()
  return # user has pressed a key, so return.
 
 # Display the DISPLAYSURF contents to the actual screen.
 pygame.display.update()
 FPSCLOCK.tick()
 
 
def readLevelsFile(filename):
 assert os.path.exists(filename), 'Cannot find the level file: %s' % (filename)
 mapFile = open(filename, 'r')
 # Each level must end with a blank line
 content = mapFile.readlines() + ['\r\n']
 mapFile.close()
 
 levels = [] # Will contain a list of level objects.
 levelNum = 0
 mapTextLines = [] # contains the lines for a single level's map.
 mapObj = [] # the map object made from the data in mapTextLines
 for lineNum in range(len(content)):
 # Process each line that was in the level file.
 line = content[lineNum].rstrip('\r\n')
 
 if ';' in line:
  # Ignore the ; lines, they're comments in the level file.
  line = line[:line.find(';')]
 
 if line != '':
  # This line is part of the map.
  mapTextLines.append(line)
 elif line == '' and len(mapTextLines) > 0:
  # A blank line indicates the end of a level's map in the file.
  # Convert the text in mapTextLines into a level object.
 
  # Find the longest row in the map.
  maxWidth = -1
  for i in range(len(mapTextLines)):
  if len(mapTextLines[i]) > maxWidth:
   maxWidth = len(mapTextLines[i])
  # Add spaces to the ends of the shorter rows. This
  # ensures the map will be rectangular.
  for i in range(len(mapTextLines)):
  mapTextLines[i] += ' ' * (maxWidth - len(mapTextLines[i]))
 
  # Convert mapTextLines to a map object.
  for x in range(len(mapTextLines[0])):
  mapObj.append([])
  for y in range(len(mapTextLines)):
  for x in range(maxWidth):
   mapObj[x].append(mapTextLines[y][x])
 
  # Loop through the spaces in the map and find the @, ., and $
  # characters for the starting game state.
  startx = None # The x and y for the player's starting position
  starty = None
  goals = [] # list of (x, y) tuples for each goal.
  stars = [] # list of (x, y) for each star's starting position.
  for x in range(maxWidth):
  for y in range(len(mapObj[x])):
   if mapObj[x][y] in ('@', '+'):
   # '@' is player, '+' is player & goal
   startx = x
   starty = y
   if mapObj[x][y] in ('.', '+', '*'):
   # '.' is goal, '*' is star & goal
   goals.append((x, y))
   if mapObj[x][y] in ('$', '*'):
   # '$' is star
   stars.append((x, y))
 
  # Basic level design sanity checks:
  assert startx != None and starty != None, 'Level %s (around line %s) in %s is missing a "@" or "+" to mark the start point.' % (levelNum+1, lineNum, filename)
  assert len(goals) > 0, 'Level %s (around line %s) in %s must have at least one goal.' % (levelNum+1, lineNum, filename)
  assert len(stars) >= len(goals), 'Level %s (around line %s) in %s is impossible to solve. It has %s goals but only %s stars.' % (levelNum+1, lineNum, filename, len(goals), len(stars))
 
  # Create level object and starting game state object.
  gameStateObj = {'player': (startx, starty),
    'stepCounter': 0,
    'stars': stars}
  levelObj = {'width': maxWidth,
   'height': len(mapObj),
   'mapObj': mapObj,
   'goals': goals,
   'startState': gameStateObj}
 
  levels.append(levelObj)
 
  # Reset the variables for reading the next map.
  mapTextLines = []
  mapObj = []
  gameStateObj = {}
  levelNum += 1
 return levels
 
 
def floodFill(mapObj, x, y, oldCharacter, newCharacter):
 """Changes any values matching oldCharacter on the map object to
 newCharacter at the (x, y) position, and does the same for the
 positions to the left, right, down, and up of (x, y), recursively."""
 
 # In this game, the flood fill algorithm creates the inside/outside
 # floor distinction. This is a "recursive" function.
 # For more info on the Flood Fill algorithm, see:
 # http://en.wikipedia.org/wiki/Flood_fill
 if mapObj[x][y] == oldCharacter:
 mapObj[x][y] = newCharacter
 
 if x < len(mapObj) - 1 and mapObj[x+1][y] == oldCharacter:
 floodFill(mapObj, x+1, y, oldCharacter, newCharacter) # call right
 if x > 0 and mapObj[x-1][y] == oldCharacter:
 floodFill(mapObj, x-1, y, oldCharacter, newCharacter) # call left
 if y < len(mapObj[x]) - 1 and mapObj[x][y+1] == oldCharacter:
 floodFill(mapObj, x, y+1, oldCharacter, newCharacter) # call down
 if y > 0 and mapObj[x][y-1] == oldCharacter:
 floodFill(mapObj, x, y-1, oldCharacter, newCharacter) # call up
 
 
def drawMap(mapObj, gameStateObj, goals):
 """Draws the map to a Surface object, including the player and
 stars. This function does not call pygame.display.update(), nor
 does it draw the "Level" and "Steps" text in the corner."""
 
 # mapSurf will be the single Surface object that the tiles are drawn
 # on, so that it is easy to position the entire map on the DISPLAYSURF
 # Surface object. First, the width and height must be calculated.
 mapSurfWidth = len(mapObj) * TILEWIDTH
 mapSurfHeight = (len(mapObj[0]) - 1) * TILEFLOORHEIGHT + TILEHEIGHT
 mapSurf = pygame.Surface((mapSurfWidth, mapSurfHeight))
 mapSurf.fill(BGCOLOR) # start with a blank color on the surface.
 
 # Draw the tile sprites onto this surface.
 for x in range(len(mapObj)):
 for y in range(len(mapObj[x])):
  spaceRect = pygame.Rect((x * TILEWIDTH, y * TILEFLOORHEIGHT, TILEWIDTH, TILEHEIGHT))
  if mapObj[x][y] in TILEMAPPING:
  baseTile = TILEMAPPING[mapObj[x][y]]
  elif mapObj[x][y] in OUTSIDEDECOMAPPING:
  baseTile = TILEMAPPING[' ']
 
  # First draw the base ground/wall tile.
  mapSurf.blit(baseTile, spaceRect)
 
  if mapObj[x][y] in OUTSIDEDECOMAPPING:
  # Draw any tree/rock decorations that are on this tile.
  mapSurf.blit(OUTSIDEDECOMAPPING[mapObj[x][y]], spaceRect)
  elif (x, y) in gameStateObj['stars']:
  if (x, y) in goals:
   # A goal AND star are on this space, draw goal first.
   mapSurf.blit(IMAGESDICT['covered goal'], spaceRect)
  # Then draw the star sprite.
  mapSurf.blit(IMAGESDICT['star'], spaceRect)
  elif (x, y) in goals:
  # Draw a goal without a star on it.
  mapSurf.blit(IMAGESDICT['uncovered goal'], spaceRect)
 
  # Last draw the player on the board.
  if (x, y) == gameStateObj['player']:
  # Note: The value "currentImage" refers
  # to a key in "PLAYERIMAGES" which has the
  # specific player image we want to show.
  mapSurf.blit(PLAYERIMAGES[currentImage], spaceRect)
 
 return mapSurf
 
 
def isLevelFinished(levelObj, gameStateObj):
 """Returns True if all the goals have stars in them."""
 for goal in levelObj['goals']:
 if goal not in gameStateObj['stars']:
  # Found a space with a goal but no star on it.
  return False
 return True
 
 
def terminate():
 pygame.quit()
 sys.exit()
 
 
if __name__ == '__main__':
 main()

配套资源下载

python使用pygame框架实现推箱子游戏

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持三水点靠木。

Python 相关文章推荐
Python中实现对Timestamp和Datetime及UTC时间之间的转换
Apr 08 Python
利用Python读取txt文档的方法讲解
Jun 23 Python
Python定义二叉树及4种遍历方法实例详解
Jul 05 Python
python中scikit-learn机器代码实例
Aug 05 Python
python用plt画图时,cmp设置方法
Dec 13 Python
python代码 输入数字使其反向输出的方法
Dec 22 Python
pycharm修改file type方式
Nov 19 Python
使用Python实现画一个中国地图
Nov 23 Python
python pprint模块中print()和pprint()两者的区别
Feb 10 Python
Python类和实例的属性机制原理详解
Mar 21 Python
python+requests接口自动化框架的实现
Aug 31 Python
分享Python获取本机IP地址的几种方法
Mar 17 Python
浅析python的优势和不足之处
Nov 20 #Python
opencv实现图片模糊和锐化操作
Nov 19 #Python
python实现朴素贝叶斯算法
Nov 19 #Python
朴素贝叶斯Python实例及解析
Nov 19 #Python
python版大富翁源代码分享
Nov 19 #Python
python获取微信小程序手机号并绑定遇到的坑
Nov 19 #Python
python实现推箱子游戏
Mar 25 #Python
You might like
理解PHP5中static和const关键字的区别
2007/03/19 PHP
PHP文件操作方法汇总
2015/07/01 PHP
Thinkphp 框架扩展之Widget扩展实现方法分析
2020/04/23 PHP
用JS实现的一个include函数
2007/07/21 Javascript
使用JavaScript实现网页版Pongo设计思路及源代码分享
2014/06/16 Javascript
原生js和jquery实现图片轮播淡入淡出效果
2015/04/23 Javascript
简介JavaScript中strike()方法的使用
2015/06/08 Javascript
jQuery 3.0十大新特性
2016/07/06 Javascript
输入法的回车与消息发送快捷键回车的冲突解决方法
2016/08/09 Javascript
基于jQuery中ajax的相关方法汇总(必看篇)
2017/11/08 jQuery
360doc网站不登录就无法复制内容的解决方法
2018/01/27 Javascript
vue webpack实用技巧总结
2018/04/24 Javascript
基于jquery实现左右上下移动效果
2018/05/02 jQuery
利用nodeJs anywhere搭建本地服务器环境的方法
2018/05/12 NodeJs
vue中的自定义分页插件组件的示例
2018/08/18 Javascript
基于layui数据表格以及传数据的方式
2018/08/19 Javascript
Javascript实现时间倒计时功能
2018/11/17 Javascript
vue插件mescroll.js实现移动端上拉加载和下拉刷新
2019/03/07 Javascript
vue动态禁用控件绑定disable的例子
2019/10/28 Javascript
python自动裁剪图像代码分享
2017/11/25 Python
基于virtualenv创建python虚拟环境过程图解
2020/03/30 Python
Python实现列表索引批量删除的5种方法
2020/11/16 Python
Expedia泰国:预订机票、酒店和旅游包(航班+酒店)
2016/09/27 全球购物
美国波道夫·古德曼百货官网:Bergdorf Goodman
2017/11/07 全球购物
英国家庭珠宝商:T. H. Baker
2018/02/08 全球购物
毕业生造价工程师求职信
2013/10/17 职场文书
《学会合作》教学反思
2014/04/12 职场文书
自强之星事迹材料
2014/05/12 职场文书
奶茶店创业计划书
2014/08/14 职场文书
党支部对转正的意见
2015/06/02 职场文书
运动会3000米加油稿
2015/07/21 职场文书
经典爱情感言
2015/08/03 职场文书
导游词之南京夫子庙
2019/12/09 职场文书
深度学习小工程练习之垃圾分类详解
2021/04/14 Python
MySQL数字类型自增的坑
2021/05/07 MySQL
python在package下继续嵌套一个package
2022/04/14 Python