
编程(Python)
Python 实战
程序ape老李
这个作者很懒,什么都没留下…
展开
-
Python学习历程
第一写博客,希望大家多提点意见!谢谢python简单爬虫练习:import urllib.requestimport os ##新建文件夹## 爬取网页 HTML 的函数def url_open(url): req = urllib.request.Request(url) req.add_header('User-Agent','Mozilla/5.0 (Window...原创 2018-09-20 11:33:54 · 201 阅读 · 0 评论 -
Pygame安装
安装 Pygamewin + R输入 : py -m pip install -U pygame --user测试 : py -m pygame.examples.aliens转载 2018-09-21 17:27:10 · 692 阅读 · 0 评论 -
Python正则表达
正则表达式import re正则表达式里 . 表示任何字符re.search(r’[aeiou]’,‘I love You’) ## 区分大小写re.search(r’[0-4]’,‘I love You’) ## 可以用 - 表示范围re.search(r’ab{3}’,‘abbbc’) ## {} 表示 前面的字母重复三次re.search(r’ab{3,10}’,‘abbbb...原创 2018-09-28 08:57:17 · 440 阅读 · 0 评论 -
Pygame键盘输入和鼠标操作
'''================Pygame模拟键盘输入和鼠标操作----------------------------------------姓名 : 昔年时间 : 2018/10/9'''import sys##初始化pygame.init()##变量存放处size = width,height = 600,400bgColor = (0,0,0)##設...原创 2018-10-09 20:33:28 · 10779 阅读 · 2 评论 -
Python飞机大战代码
Python飞机大战代码,分五个文件存放,每个文件代表着不同的功能!main.pyimport pygameimport sysimport tracebackimport myplaneimport enemyimport bulletimport supplyfrom pygame.locals import *from random import *pygame.i...原创 2018-10-30 19:50:22 · 9499 阅读 · 2 评论 -
Pygaem.rect
属性 & 方法pygame.Rect.copy() — 拷贝 Rect 对象pygame.Rect.move() — 移动 Rect 对象pygame.Rect.move_ip() — 原地移动 Rect 对象pygame.Rect.inflate() — 放大和缩小 Rect 对象的尺寸pygame.Rect.inflate_ip() — 原地放大和缩小 R...转载 2018-10-30 20:20:25 · 539 阅读 · 0 评论 -
Pyhton 的 time 库
import time # 加载时间库获取时间的函数time 获取时间戳ctime 以一种易读的方式获取时间翻译 2018-11-21 20:31:37 · 718 阅读 · 0 评论