爬取豆瓣电影评分 Read More
posted @ 2018-08-22 19:36
葡萄想柠檬
Views(433)
Comments(0)
Diggs(0)
什么是异常? 什么是异常? 什么时候容易出现异常? 当要处理的内容不确定的时候 : 有用户参与时, 有外界数据接入 : 从文件中读取, 从网络上获取 当有多行报错的时候是为什么? 如何进行异常处理? 单分支 try ... except 多分支 try ... except ... except 多 Read More
posted @ 2018-08-22 17:13
葡萄想柠檬
Views(127)
Comments(0)
Diggs(0)
【第一篇】python基础 循环语句 格式化输出 运算符 编码 数据类型 ( int bool str ) 数据类型 ( list tuple ) 数据类型 ( dict ) == is 编码和解码 set集合 fromkeys( ) 深浅拷贝 文件操作 work+test 【第二篇】python函 Read More
posted @ 2018-08-22 17:11
葡萄想柠檬
Views(918)
Comments(0)
Diggs(0)
# 6、写一个用户注册登陆的程序,每一个用户的注册都要把 # 用户名和密码用字典的格式写入文件userinfo。 # 在登陆的时候,再从文件中读取信息进行验证。 # dic = {'alex':'alex3714'} import pickle def register(): user_name = input('请输入用户名:') password = input('请输入... Read More
posted @ 2018-08-22 17:05
葡萄想柠檬
Views(198)
Comments(0)
Diggs(0)
# 验证码 import random def r_code(n,alpha = True): s = '' for i in range(n): num = str(random.randint(0,9)) if alpha: alpha1 = chr(random.randint(65,90)) ... Read More
posted @ 2018-08-22 16:57
葡萄想柠檬
Views(105)
Comments(0)
Diggs(0)
# 1、写一个函数,接受一个参数,如果是文件,就执行这个文件,如果是文件夹,就执行这个文件夹下所有的py文件 import os def func(path): if os.path.isfile(path) and path.endswith('.py'): #判断是否为文件且 .py文件 os.system('python %s'%path) ... Read More
posted @ 2018-08-22 15:29
葡萄想柠檬
Views(257)
Comments(0)
Diggs(0)

浙公网安备 33010602011771号