Skip to content

Instantly share code, notes, and snippets.

@lovemyliwu
Created January 31, 2018 03:14
Show Gist options
  • Save lovemyliwu/2503de9f765fa9f1448615bfc3408d64 to your computer and use it in GitHub Desktop.
Save lovemyliwu/2503de9f765fa9f1448615bfc3408d64 to your computer and use it in GitHub Desktop.

###前置知识

会一门基本的命令式编程语言(vb/c/c++/java/js等)或了解基本的编程概念(变量,函数,类等)

###目标

熟悉并能使用Python做一些实际的事情, 一共有三个部分的培训, 每个部分培训时长应在3个小时内,讲演结合.结束之后留有课后作业, 完成课后作业视为达成目标.

online python REPL:https://repl.it/languages/python

###内容

  1. Python入门 http://www.diveintopython.net/toc/index.html

    1. python安装
    2. hello world例子
    3. 基本类型

    作业: 给定n,输出nn乘法表, 例如55乘法表有:(2*1=2,2*2=4...,2*5=10),(3*1=...,3*5=15),...,(5*1...5*5)

    ppt: https://docs.google.com/presentation/d/1eF_Qo1izTpZvycTAxprXnVUJ5uBoKyi4CK6qOKVzwY0/edit?usp=sharing

  2. Python进阶 http://www.diveintopython.net/toc/index.html

    1. python内省
    2. Python对象
    3. 异常处理和文件读写
    4. json和request http://docs.python-requests.org/en/master/

    作业: 请求https://jsonplaceholder.typicode.com/postshttps://jsonplaceholder.typicode.com/users, 获取文章数据和用户信息, 将数据清洗取出每一篇文章的标题和作者, 输出到文件保存. 文件内如形如:

标题: qui est esse, 作者: Leanne Graham 标题: xxx, 作者: xxx ``` ppt: https://docs.google.com/presentation/d/1kXTdpiigxhzY8e2rGZRPIFa_yWMCFtMhGpywzzJUlJM/edit?usp=sharing

  1. Python高级

    1. 正则表达式 http://www.diveintopython.net/toc/index.html
    2. xpath和lxml https://docs.python.org/2/library/xml.etree.elementtree.html
    3. UT和mock https://docs.python.org/3/library/unittest.mock.html
    4. ORM和sqlalchemy https://www.sqlalchemy.org/

    作业: 爬取http://news.baidu.com/, 国际新闻, 将新闻的标题, 时间, 作者, url存储到数据库中

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment