OMG that's another blog!

1.Beginning
we'v learnt how to ask file from our own computer and tried to built a new wordcloud.
#1.读取文件内容
import jieba
import wordcloud
from imageio import imread
with open(r'C:\Users\Jinyy\Desktop\新建文件夹\第十二期上课笔记\day5\1.txt','r',encoding='utf8')as f:
data=f.read()
#2.使用结巴模块对文件内容切割
jieba.add_word('诺森德的守望')#让回家的诱惑成为单词
# jieba.del_word('先生')#删除
data_list=jieba.lcut(data)
data=''.join(data_list)
print(data)
#3.找到这招图片
img=imread(r'C:\Users\Jinyy\Desktop\新建文件夹\第十二期上课笔记\day4\fill.png')
#3.使用词云模块生成词云
w=wordcloud.WordCloud(font_path='C:\Windows\Fonts\simsun.ttc',background_color='white',mask=img)
w.generate(data)
w.to_file('诺森德的守望.png')
2.then
Nick was gone and Mr.tank are cuming(coming) to show us how to use network crawler to steal files from internet,that was really a cool trick now I can download porn video for freeeeeeeee!
'''
requests请求库
pip3 install requests
'''
import requests
# 1.发送请求
#get 发送请求
response=requests.get(
url='http://pic16_2.qiyeku.com/qiyeku_pic/2016/6/27/zsliying/product/product_pic/image/2016_07_11/20160711085044523.jpg'
)
#接受二进制流
# print(response.content)
#保存数据
with open('porn1.jpg','wb')as f:
f.write(response.content)
print('图片下载成功!')
response2=requests.get(
url='https://media.st.dl.bscstorage.net/steam/apps/256738414/movie_max.webm'
)
# print(response2.content)
#把二进制报仇呢本地
#凡是二进制流数据,不需要指定字符编码
with open('1.webm','wb')as f2:
f2.write(response2.content)
print('视频下载成功')
import requests
import re
#fasongqingqiu
response=requests.get(
url='http://www.xbiquge.la/15/15428/'
)
response.encoding = 'utf-8'
print(response.text)
'''
1电影名称
2电影详情页连接
3评分
4评价人数
'''
#解析并提取数据
#查找所有
# re.S:全局查找
# re.findall('正则匹配规则','解析文本',re.S)
#.*?是贪婪匹配
moviename=re.findall('.*?<div id="list">(.*?)</div>','response.text',re.S)
print(moviename)
the top was stealing picture and video ,the button was stealing text file
this won't be the last time we met/
OMG that's another blog!的更多相关文章
- http://blog.csdn.net/zgl07/article/details/43491399
转载申明:本文转载自http://www.brendangregg.com/perf.html 请大家看了之后如果要转载一定要注上这个地址!!! ========================= ...
- 日向blog开发记录
一点历史关于,Sonne Blog 2016.03.25springmvc + hibernate框架搭建.2016.04.21日向blog首页.2016.04.24分页实现.2016.04.30登录 ...
- blog (后续更新)
设计Model(设计数据库) from django.db import models # Create your models here. class BlogsPost(models.Model) ...
- tensorflow 一些好的blog链接和tensorflow gpu版本安装
pading :SAME,VALID 区别 http://blog.csdn.net/mao_xiao_feng/article/details/53444333 tensorflow实现的各种算法 ...
- http://blog.csdn.net/java2000_wl/article/details/8627874
http://blog.csdn.net/java2000_wl/article/details/8627874
- [Android Pro] http://blog.csdn.net/wuyinlei/article/category/5773375
http://blog.csdn.net/wuyinlei/article/category/5773375
- android 蓝牙 http://blog.csdn.net/u012843100/article/details/52384219
http://blog.csdn.net/u012843100/article/details/52384219
- 【三】用Markdown写blog的常用操作
本系列有五篇:分别是 [一]Ubuntu14.04+Jekyll+Github Pages搭建静态博客:主要是安装方面 [二]jekyll 的使用 :主要是jekyll的配置 [三]Markdown+ ...
- django开发个人简易Blog—nginx+uwsgin+django1.6+mysql 部署到CentOS6.5
前面说完了此项目的创建及数据模型设计的过程.如果未看过,可以到这里查看,并且项目源码已经放大到github上,可以去这里下载. 代码也已经部署到sina sea上,地址为http://fengzhen ...
随机推荐
- centors7 和 win7 修改开机顺序
打开/boot/grub2/grub.cfg,找到windows对应的项 我的是 Windows 7 (loader) (on /dev/sda1) 执行命令 grub2-set-default &q ...
- HashSet、LinkedHashSet、TreeSet的区别
HashSet:哈希表是通过使用称为散列法的机制来存储信息的,元素并没有以某种特定顺序来存放: LinkedHashSet:以元素插入的顺序来维护集合的链接表,允许以插入的顺序在集合中迭代: Tree ...
- linux 命令 - man, help, info(查看命令帮助手册)
man, help, info - 查看命令帮助手册 help xxx # 显示内置命令帮助信息: xxx --help # 显示外置命令帮助信息: man xxx # 没有内建与外部命令的 ...
- ubtuntu下虚拟环境搭建【python】
为什么要搭建虚拟环境? 在开发过程中, 当需要使用python的某些工具包/框架时需要联网安装 比如联网安装Flask框架flask-0.10.1版本 sudo pip install flask== ...
- oracle hint 强制索引(转)
oracle 1.建议建立一个以paytime,id,cost的复合索引.光是在paytime上建立索引会产生很多随机读.2.就算建立了索引,如果你查询的数据量很大的话,也不一定会用索引,有时候全表扫 ...
- java中的final关键字的用法
一. 什么是final关键字? final在Java中是一个保留的关键字,可以声明成员变量.方法.类以及本地变量.一旦你将引用声明作final,你将不能改变这个引用了,编译器会检查代码,如果你试图将变 ...
- Vue学习笔记【23】——Vue组件(组件的定义)
定义Vue组件 什么是组件: 组件的出现,就是为了拆分Vue实例的代码量的,能够让我们以不同的组件,来划分不同的功能模块,将来我们需要什么样的功能,就可以去调用对应的组件即可: 组件化和模块化的不同: ...
- C存储类
C 存储类 存储类定义 C 程序中变量/函数的范围(可见性)和生命周期.这些说明符放置在它们所修饰的类型之前.下面列出 C 程序中可用的存储类: auto register static extern ...
- CSS3布局篇(多列布局)
我们通过学习 CSS3,能够创建多个列来对文本进行布局 ,就像报纸那样排版那样! 可以参考详细说明:http://www.w3school.com.cn/css3/css3_multiple_colu ...
- 高级运维(一):反向代理&使用Varnish加速Web
案例1.反向代理 目标: 1.代理服务器可以将远程的Web服务器页面缓存于本地 2.代理服务器端口设置为80端口 3.用户通过访问代理服务器即可获得远程Web服务器页面上的内容 4.远程We ...