- 博客(13)
- 收藏
- 关注
原创 requests和xpath
requests_get print(response.text) #页面源码 print(response.status_code) #状态码 print(response.headers) #响应头 print(response.request.headers) #获取请求头 print(response.content) #获取页面的二进制数据 如果获取的是json字符串,可以调用jso...
2019-09-09 20:31:12
372
原创 urllib和正则
urllib urllib是python内部自带的一个用于爬虫的组件 如何使用urllib GET 1 导入 from urllib import request 2 发起请求 <1> 创建一个request对象 url > 目标url地址 data=None 默认为None 表示是一个get请求 反之为post请求 headers={} 请求头 <2> 发起请求...
2019-09-09 09:12:09
196
原创 飞机大战
import pygame class GameSprite(pygame.sprite.Sprite): def init(self,image_name,speed = 1): super().init() #根据指定路径下的图片名 将图片加载至内存中 self.image = pygame.image.load(image_name) #获取加载的图片宽高属性 self.rect = sel...
2019-01-08 09:00:24
242
原创 飞机大战
import pygame from GameSprite import * import random from plane_sprites import * class Enemy(GameSprite): def init(self): super().init(’./images/images/enemy1.png’) # 2. 设置敌机的随机初始速度 1 ~ 3 self.speed =...
2019-01-08 08:59:56
172
原创 飞机大战
import pygame from GameSprite import * class Bullet(GameSprite): “”“子弹精灵”"" def __init__(self): super().__init__("./images/images/bullet1.png", -20) self.down_index = 0 def update(self): super().u...
2019-01-08 08:59:22
146
原创 飞机大战
import pygame from GameSprite import * from plane_sprites import * class Background(GameSprite): def init(self,image_name): self.image = image_name super().init(self.image,2) def update(self): super()...
2019-01-08 08:58:58
144
转载 九九乘法表
line = int(input(‘输入要打印的行数’)) i = 1 while i <= line : # r = i s = 1 while s <= i: print(’%d x %d = %d’%(s,i,s*i),end=’\t’) s += 1 print(’’) i += 1
2019-01-08 08:57:44
470
转载 用*打印正三角形
i = 1 line = int(input(‘请输入边长’)) while i <= line: print(’*’*i) i += 1
2019-01-08 08:56:53
606
转载 用*打印等边三角形
line = int(input(‘请输入边长’)) row = 1 while row <= line: left = line - row +1 while left >0: print(’ ‘,end =’’) left -= 1 star = 2row - 1 star = row while star > 0: print(’’,end =’’) print(’ ‘,e...
2019-01-08 08:56:18
964
转载 成绩管理系统
print(‘欢迎来到成绩管理系统’.center(30,’*’)) list = [] while True: print(‘1、录入成绩’) print(‘2、查看成绩’) print(‘3、删除成绩’) print(‘4、修改成绩’) print(‘5、退出系统’) num = int(input(‘请选择功能’)) tt = {} if num == 1: name = input(‘请...
2019-01-08 08:55:16
157
转载 淘宝管理系统
list_hao = [] gouwuche = [] dingdan = [] list = [ {‘ming’:‘手机’,‘price’:‘3000’,‘count’:100}, {‘ming’:‘电脑’,‘price’:‘6000’,‘count’:30}, {‘ming’:‘数据线’,‘price’:‘150’,‘count’:100}] while True: print(‘欢迎使用淘宝...
2019-01-08 08:52:48
515
转载 用*打印平行四边形
line = int(input(‘输入数字’)) row = line while l < line : i = l while i - 1 > 0: print(’ ‘, end = ‘’) i -= 1 r = row while r > 0: print(’*’, end = ‘’) r -= 1 print(’’) l += 1 ...
2019-01-08 08:51:00
937
原创 Linux系统里常见的命令(1)
1.ls 查找文件信息 ls是英语单词list的简写,功能是列出目录的内容。 常用参数有:-a、-h、-l等等 2.clear 清屏(快捷键ctrl+l) 1. history 查找历史信息 2. Tab 自动补全(在敲出命令的前几个字母时,按下tab键系统会帮我们自动补全) 3. more分屏显示 4. cd 切换工作目录 cd 切换到当前用户的主目录(/home...
2018-09-10 08:21:38
155
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅