zoukankan      html  css  js  c++  java
  • what have we learnt in day five

    what is file?

    virtual unit offered by operation system

    steps to open file

    1.find the file_path(file_path)

    2.open file(open)

    3.read or change the file(read/write)

    4.save the files(flush)

    5.close the file (close)

    three modes to open .txt file

    w:clear the file and write in

    r:can only read

    a:write in after the file

    two ways to open .txt file

    b:binary

    t:text

    you'd better not to use three ways below

    1.r+

    2.a+

    3.w+

    with in charge of the context

    f=open()
    f.read()
    #close file automaticly
    with open() as f
         f.read()
    

    principle of crawler

    send requests through explore to get files,through requests module analog browser gets content

    process of crawler

    1.send requests(filling url)

    2.get context

    3.choose the value you need

    use of requests module

    import requests
    res=requests.get(url)
    #wenben
    res.txt
    #erjinzhiliu
    res.content
    

    re module

    re.S search all

    re.findall() choose what you need in the context

    if you need anything just(.*?)

  • 相关阅读:
    锻炼意志力
    iOS 函数积累
    iOS8新特性 计算 cell 的高度
    iOS 国际化支持 设置
    CALayer 方法属性整理
    好的 blog 整理
    xcode7 打包上传至 app store
    ios 适配 (字体 以及 控件)
    iOS 适配设计与切图
    iOS app 切图
  • 原文地址:https://www.cnblogs.com/jimGraymane/p/11425882.html
Copyright © 2011-2022 走看看