Code Monkey home page Code Monkey logo

learnpython's Introduction

LearnPython

以撸代码的形式学习Python, 具体说明在知乎专栏-撸代码,学知识

===================================================================================================

python_base.py: 千行代码入门Python

python_visual.py: 15张图入门Matplotlib

python_visual_animation.py: 使用Matplotlib画动态图实例

python_spider.py: 一个很“水”的Python爬虫入门代码文件

python_weibo.py: “史上最详细”的Python模拟登录新浪微博流程

python_lda.py: 玩点高级的--带你入门Topic模型LDA(小改进+附源码)

python_sqlalchemy.py: 作为一个Pythoner, 不会SQLAlchemy都不好意思跟同行打招呼!

python_oneline.py: 几个小例子告诉你, 一行Python代码能干哪些事

python_requests.py: Python中最好用的爬虫库Requests代码实例

python_functional.py: Python进阶: 函数式编程实例(附代码)

python_decorator.py: Python进阶: 通过实例详解装饰器(附代码)

python_datetime.py: 你真的了解Python中的日期时间处理吗?

python_metaclass.py: Python进阶: 一步步理解Python中的元类metaclass

python_coroutine.py: Python进阶: 理解Python中的异步IO和协程(Coroutine), 并应用在爬虫中

python_aiohttp.py: Python中最好用的异步爬虫库Aiohttp代码实例

python_thread_multiprocess.py: Python进阶: 聊聊IO密集型任务、计算密集型任务,以及多线程、多进程

python_version36.py: Python3.6正式版要来了, 你期待哪些新特性?

python_magic_methods: Python进阶: 实例讲解Python中的魔法函数(Magic Methods)

python_restful_api.py: 利用Python和Flask快速开发RESTful API

python_restful_api.py: RESTful API进阶: 连接数据库、添加参数、Token认证、返回代码说明等

python_context.py: With语句和上下文管理器ContextManager

python_flask.py: Flask相关说明

MyShow: 玩点好玩的--知乎全部话题关系可视化

python_markov_chain.py: 玩点好玩的--使用马尔可夫模型自动生成文章

python_wechat.py: 玩点好玩的--自己写一个微信小助手

python_csv.py: Python中CSV文件的简单读写

python_numpy.py: 使用numpy进行矩阵操作

python_mail.py: 使用Python自动发送邮件,包括发送HTML以及图片、附件等

python_redis.py: Python操作Redis实现消息的发布与订阅

python_schedule.py: Python进行调度开发

python_socket.py: Python的socket开发实例

Plotly目录: 一些plotly画图的实例,使用jupyter notebook编写

===================================================================================================

您可以fork该项目, 并在修改后提交Pull request, 看到后会尽量进行代码合并

learnpython's People

Contributors

0xkookoo avatar andyron avatar cuican-wang avatar gaufung avatar keloli avatar krisyu avatar qingmu avatar rrdssfgcs avatar rydesun avatar wuhongyewhy avatar xianhu avatar xuezhai-f avatar zhisheng17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

learnpython's Issues

集合set

file:python_base.py
lineno:83
t = set("Hello") # 创建一个唯一字符的集合返回{}

set("Hello")
返回:{'l', 'H', 'e', 'o'}

Keyword-Only是不是出问题了

python_base.py L524

    # Keyword-Only参数:出现在*args之后 必须用关键字进行匹配
    def keyOnly(a, *b, c): print('')   # c就为keyword-only匹配 必须使用关键字c = value匹配
    def keyOnly(a, *, b, c): ......    # b c为keyword-only匹配 必须使用关键字匹配
    def keyOnly(a, *, b = 1): ......   # b有默认值 或者省略 或者使用关键字参数b = value

def keyOnly(a, *b, c) 是不是应该是 def keyOnly(a, c, *b) ?
def keyOnly(a, *, b, c) 这边的*怎么理解?

运行过程中报错,无法登录

请问你用的什么环境?我用的是Python2.7,在运行过程中报错:
2016-11-09 21:57:24,653 INFO Starting new HTTP connection (1): 127.0.0.1
2016-11-09 21:57:27,233 DEBUG "GET http://weibo.com/login.php HTTP/1.1" 200 None
2016-11-09 21:57:31,757 INFO Resetting dropped connection: 127.0.0.1
2016-11-09 21:57:31,871 DEBUG "GET http://login.sina.com.cn/sso/prelogin.php?checkpin=1&su=&callback=sinaSSOController.preloginCallBack&rsakt=mod&client=ssologin.js%28v1.4.18%29&entry=weibo&_=1478699847240 HTTP/1.1" 200 None
2016-11-09 21:57:31,872 DEBUG WeiBoLogin get_json_data: {u'nonce': u'RHMSEX', u'rsakv': u'1330428213', u'retcode': 0, u'exectime': 9, u'servertime': 1478699850, u'pcid': u'gz-789fcba1ca6723b1b64d880551d5c5b0081e', u'pubkey': u'EB2A38568661887FA180BDDB5CABD5F21C7BFD59C090CB2D245A87AC253062882729293E5506350508E7F9AA3BB77F4333231490F915F6D63C55FE2F08A49B353F444AD3993CACC02DB784ABBB8E42A9B1BBFFFB38BE18D78E87A0E41B9B8F73A928EE0CCEE1F6739884B9777E4FE9E88A1BBE495927AC4A799B3181D6442443'}
2016-11-09 21:57:36,384 INFO Resetting dropped connection: 127.0.0.1
2016-11-09 21:57:36,696 DEBUG "POST http://login.sina.com.cn/sso/login.php?client=ssologin.js(v1.4.18)&_=1478699851 HTTP/1.1" 200 None
Traceback (most recent call last):
File "C:/Users/zheng/PycharmProjects/spider/weibo.py", line 159, in
weibo.login()
File "C:/Users/zheng/PycharmProjects/spider/weibo.py", line 92, in login
json_data_1 = self.session.post(login_url_1, data=post_data).json()
File "C:\Python27\lib\requests\models.py", line 826, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Python27\lib\json_init_.py", line 339, in loads
return _default_decoder.decode(s)
File "C:\Python27\lib\json\decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Python27\lib\json\decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Change Navbar -> NavbarSimple

Hi

Thanks for using dash-bootstrap-components! I just wanted to let you know that we made a breaking change to the Navbar component, so if you update to version 0.3.0 or later of dash-bootstrap-components you might get unexpected behaviour.

You can use the new NavbarSimple component exactly as you are currently using Navbar currently, so the easiest fix would be to just change Navbar to NavbarSimple.

Check out the docs for Navbar and our examples for more details.

笔误?

python_base.py

set是可变对象,即不存在hash值,不能作为字典的键值。同样的还有list、tuple等 frozenset是不可变对象,即存在hash值,可作为字典的键值 frozenset对象没有add、remove等方法,但有union/intersection/difference等方法
tuple 是不可变对象,这里是笔误么?

python_base.py的295行报错

解释器版本: 3.6.4
a = ([1,2])
a[0][1] = 0
报错
元组不写逗号, 默认是一个变量, 不能通过索引得到
正确写法:
a = ([1,2], )
a[0][1] = 0

python_csv.py

Maybe using pandas as csv tutorial will be better?

一行代码输出Mandelbrot图像

可不可以请大神把这行代码翻译成普通def形式。主要是不清楚lambda z, c, n: a(a, z, c, n)这一行返回的是什么。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.