随笔分类 - Pygame
摘要:1 #requests+正则表达式爬取ip 2 #findall方法,如果表达式中包含有子组,则会把子组单独返回出来,如果有多个子组,则会组合成元祖 3 import requests 4 import re 5 def get_ip(url): 6 headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) Appl...
阅读全文
摘要:pygame.display pygame中用于控制窗口和屏幕显示的模块。 为了适应语境,display在该文档中有时翻译为‘显示’或者显示界面。 这个模块提供控制pygame显示界面(display)的各种函数。 pygame的surface对象即可显示为一个窗口,也可以全屏模式显示。 当你创建并
阅读全文
摘要:1 import pygame 2 import sys 3 from pygame.locals import * 4 5 # 初始化Pygame 6 pygame.init() 7 8 size = width, height = 600, 400 9 speed = [-2, 1] 10 bg = (255, 255, 255) # RGB 11 12 # 创建指定...
阅读全文