会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
种一棵树最好的时间是十年前,其次是现在
博客园
首页
新随笔
联系
管理
订阅
1
2
下一页
[置顶]
Scrapy爬取慕课网(imooc)所有课程数据并存入MySQL数据库
摘要: 爬取目标:使用scrapy爬取所有课程数据,分别为 1.课程名 2.课程简介 3.课程等级 4.学习人数 并存入MySQL数据库 (目标网址 http://www.imooc.com/course/list) 一.导出数据文件到本地 1.新建imooc项目 1 scrapy startproject
阅读全文
posted @ 2017-08-03 11:31 1109159477
阅读(1311)
评论(0)
推荐(0)
2018年8月15日
关于读取properties文件路径问题
摘要: 1 1.方法一 2 InputStream fis =TestProperties.class.getClassLoader().getResourceAsStream(“init.properties”) 3 4 2.方法二(要求TestProperties和init.properties在同一目录下) 5 InputStream fis =TestProperties.cla...
阅读全文
posted @ 2018-08-15 11:35 1109159477
阅读(1264)
评论(0)
推荐(0)
2018年4月3日
python随机生成测试数据用户名
摘要: import random #对应从'0'到'9'的ASCII码 48~57 #对应从'A'到'Z'的ASCII码 65~90 #对应从'a'到'z'的ASCII码 97~122 def get_aZ(): num=random.randint(65,122) if num96: return chr(num) ...
阅读全文
posted @ 2018-04-03 17:20 1109159477
阅读(306)
评论(0)
推荐(0)
2017年12月8日
字典的应用(根据第一列,统计第二列之和)
摘要: 1 #-*- coding:utf-8 -*- 2 #根据第一列,统计和 3 4 ''' 5 cat info.txt 6 7 lisa,99 8 bart,80 9 lisa,100 10 bart,89 11 tom,87 12 13 ''' 14 15 d={} 16 with open('info.txt') as f: 17 for line in ...
阅读全文
posted @ 2017-12-08 17:30 1109159477
阅读(171)
评论(0)
推荐(0)
冒泡算法和排序算法运行速度比较
摘要: 1 #-*- encoding= utf-8 -*- 2 from random import randint 3 import datetime 4 5 s=[] 6 7 for i in range(0,10000): 8 s.append(randint(1,10000)) 9 10 #排序算法 11 def sort_list(list): 12 ...
阅读全文
posted @ 2017-12-08 17:07 1109159477
阅读(184)
评论(0)
推荐(0)
2017年12月7日
python MySQLdb包 增删改查简单应用
摘要: 1 #! /usr/bin/env python 2 # -*- coding: utf-8 -*- 3 import MySQLdb 4 5 class Database: 6 def __init__(self,user,passwd,db,host,port): 7 self.user=user 8 self.pas...
阅读全文
posted @ 2017-12-07 22:34 1109159477
阅读(1022)
评论(0)
推荐(0)
2017年10月20日
判断日期天数
摘要: 1 #coding:utf-8 2 from collections import OrderedDict 3 import datetime 4 dt=['20171001','20171001','20171002','20171003','20171005','20171006','20171006','20171008','20171009','20171010','201710...
阅读全文
posted @ 2017-10-20 16:25 1109159477
阅读(305)
评论(0)
推荐(0)
2017年6月11日
Python爬虫抓取煎蛋(jandan.net)无聊图
摘要: python 下载煎蛋无聊图
阅读全文
posted @ 2017-06-11 03:28 1109159477
阅读(916)
评论(0)
推荐(0)
2017年6月6日
快递查询
摘要: #encoding:UTF-8 #Python 3.4.3 import urllib import requests ''' 天天快递 运单号码: 667612364334 圆通速递 运单号码: 885300598318625893 韵达快递 运单号码: 3839920843883 ''' kd=[['申通','shentong',0], ['EMS' ,'ems',...
阅读全文
posted @ 2017-06-06 11:30 1109159477
阅读(3533)
评论(0)
推荐(0)
城市经纬度(阿里云)
摘要: #encoding:UTF-8 #Python 3.4.3 import urllib import requests def get_info(): city=input('请输入要查询的城市名称:') url='http://gc.ditu.aliyun.com/geocoding?a='+urllib.parse.quote(city) weather_data =...
阅读全文
posted @ 2017-06-06 11:28 1109159477
阅读(678)
评论(0)
推荐(0)
1
2
下一页
公告