
Python
文章平均质量分 73
波比小金刚
code change the world
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Python学习笔记1
-*- coding: utf-8 -*- Python 学习笔记(thanks for Micheal liao) # 1. 寻找素数 def _odd_iter(): n=1 while True: n=n+2 yield n def _not_divisible(n): return lambda x:x%n>0 def primes(): yield 2 it=_o原创 2016-08-17 17:01:54 · 369 阅读 · 0 评论 -
python简单爬虫,Beautifulsoup4解析,爬取直播吧部分热门新闻及链接
import urllib.request from bs4 import BeautifulSoup # 爬取直播吧新闻 url = "http://news.zhibo8.cc/zuqiu/" def __getPage(url): print("now crawler coming") page = urllib.request.urlopen(url) if page.getco原创 2016-10-18 22:00:16 · 2655 阅读 · 0 评论 -
python+beautifulsoup爬取豆瓣电影TOP250
import urllib.request from bs4 import BeautifulSoup import re # 豆瓣电影top250 def __getHtml(): data = [] pageNum = 1 pageSize = 0 try: while(pageSize <= 225): # headers = {'User-Agent':'Mozilla原创 2016-10-19 20:45:47 · 4662 阅读 · 1 评论 -
每天30分钟,轻松学会Python-part1
Python基础学习笔记part1. 算数、字符串、变量# 1. 算数、字符串与变量 # 基于python3.5 ## 算数 import mathprint(5 + 5) print(5 - 5) print(5 * 5) print(5 / 5) print(5 // 5) # 整除,不是四舍五入,而是直接舍弃小数位 print(5 % 5) # 取余数 print(5 ** 5) # 乘方#原创 2017-06-30 15:37:01 · 693 阅读 · 0 评论 -
python基础-函数
函数局部变量 和 全局变量name='Jack' def sayHello(): print('hello, {}'.format(name))def changeName(sname): name=snamesayHello()changeName('tom') # 这里的name是一个局部变量 sayHello()def changeName2(sname): globa原创 2017-07-10 22:22:48 · 291 阅读 · 0 评论 -
轻松学习python part2-控制语句
直接上笔记 很基础# 流程控制 # if pwd = input('input the password') if pwd == 'admin': print('login...') elif pwd == 'admin1': print('login as admin1') else : print('incorrect password') # 条件表达式 food =原创 2017-07-04 11:23:40 · 302 阅读 · 0 评论 -
python 学习路线
python 学习路线https://github.com/cbbfcd/whole-Python每周更新….原创 2017-08-31 09:08:32 · 575 阅读 · 0 评论