- 博客(12)
- 收藏
- 关注
原创 Translate Picture to Char-Set Picture
from PIL import Imageimport argparseparser = argparse.ArgumentParser()parser.add_argument('file')parser.add_argument('-o','--output')parser.add_argument('--width',type = int,default = 80)parser.ad
2017-12-21 17:38:31 410
原创 a-web-crawler-with-asyncio-coroutines
The one with the callback pattern:import socketfrom selectors import DefaultSelector,EVENT_WRITE,EVENT_READdef loop(): while not Stopped: events = selector.select() for event_key,e
2017-12-21 17:37:21 558
原创 Python Web Server Gateway Interface(WSGI)
learned by Let’s Build A Web Server. Part 2. run your Web server with multiple Web frameworks without making code changes either to the Web server or to the Web frameworksimport socket,sysfrom io imp
2017-12-14 16:06:34 243
转载 python class和class(object)用法区别-(转)
# -*- coding: utf-8 -*-# 经典类或者旧试类class A: passa = A()# 新式类class B(object): passb = B()# python2不支持# print(A.__class__)print(a.__class__)print(type(A))print(type(a))# python2# __main__.
2017-12-14 14:13:27 12586
原创 How to fix the python problem 'xxx() takes exactly one argument'
I just write a simple python code but it occurs a error in the code below:listen_socket.bind(HOST,PORT)the error print is:TypeError: bind() takes exactly one argument (2 given)the reason is that Host
2017-12-12 16:28:33 2705
转载 最新最全python镜像源-(转)
1.虽然用easy_install和pip来安装第三方库很方便 它们的原理其实就是从Python的官方源https://pypi.python.org/pypi 下载到本地,然后解包安装。 不过因为某些原因,访问官方的pypi不稳定,很慢甚至有些还时不时的访问不了。2.常见国内镜像源http://pypi.douban.com/simple/ 豆瓣http://mirrors.aliyun.com
2017-12-12 15:23:51 11392
原创 How to craw the Info of BiliBIli with python in Parallel and MySQL storage
Based on the basic code of How to craw the Info of BiliBIli with python in Parallel,adding the MySQL storage.# -*- coding:utf-8 -*-#craw bilibili info with parallel,DBimport timeimport requestsimpo
2017-12-12 14:44:42 214
原创 A simple SMTP email realized by Python
refer to SMTP发送邮件 The simplest one:from email.mime.text import MIMETextmsg = MIMEText('hello world','plain','utf-8')sender_mail = input('sender mailbox:')sender_passwd = input('sender mailbox passwa
2017-12-06 17:22:03 286
原创 How to craw the Info of BiliBIli with python in Parallel
Based on the basic code of How to craw the Info of BiliBIli with python,add the parallel:# -*- coding:utf-8 -*-#craw bilibili info with parallelimport timeimport requestsimport sysfrom prettytable
2017-12-06 15:22:49 289
原创 How to install the third party modules under the pyCharm in the Windows
Sometims I want to work under the windows.So how to install the third party modules for using in the pyCharm? Firstly make sure that the pyCharm and the python interpreter are both installed successfu
2017-12-01 12:01:07 215
原创 How to craw the Info of BiliBIli with python
It is a simple craw Script learned by Python利用B站API获取视频信息.It is a good case for a beginner just like me.In my perspective of a beginner,the key is how to analysis the JS file with an efficient, stable
2017-12-01 11:19:34 214
转载 windows系统下Python环境的搭建-(转)
windows系统下Python环境的搭建 <div class="postBody"> <div id="cnblogs_post_body"><p><span style="color:black; font-family:微软雅黑; font-size:13pt"><br>1、首先访问<a href="http://www.python
2017-12-01 10:00:47 1197
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人