Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: madscheme/introducing-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: slideclick/introducing-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 8 commits
  • 6 files changed
  • 1 contributor

Commits on Feb 19, 2016

  1. no message

    unknown authored and unknown committed Feb 19, 2016
    Configuration menu
    Copy the full SHA
    de8752c View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2016

  1. p3支持在正则中处理中文

    unknown authored and unknown committed Feb 23, 2016
    Configuration menu
    Copy the full SHA
    eadf221 View commit details
    Browse the repository at this point in the history
  2. 一个文件,它存的是字节。Rb模式读入内存,它是bytes

    如果是r模式,那么它读入内存时,需要先解码:
    f= open('Capture.PNG','r', encoding='ascii',errors='replace')
    到了内存里面,它是str
    
    这个str你repr它,会看到最外层的引号,表示它是str字面量
    
    然后这个str还可以eval成python的obj
    unknown authored and unknown committed Feb 23, 2016
    Configuration menu
    Copy the full SHA
    67886e5 View commit details
    Browse the repository at this point in the history
  3. cp936

    unknown authored and unknown committed Feb 23, 2016
    Configuration menu
    Copy the full SHA
    b7bc050 View commit details
    Browse the repository at this point in the history
  4. 正则的name

    unknown authored and unknown committed Feb 23, 2016
    Configuration menu
    Copy the full SHA
    2f05a51 View commit details
    Browse the repository at this point in the history
  5. s=b'\xe7\xa9\xbf\xe5\xb1\xb1\xe7\x94\xb2\xe5\x88\xb0\xe7\xa9\xbf\xe5\…

    …xb1\xb1\xe7\x94\xb2\xe5\x88\xb0\xe5\xba\x95\xe8\xaf\xb4\xe4\xba\x86\xe4\xbb\x80\xe4\xb9\x88\xef\xbc\x9f'
    
    #当你上行那么写时,'\xe7'是四个ascii字符,写入py源码文件中。而本文第一行的四个中文是二进制 'e7'写入py文件
    #当python解释器读到s=b''这个写法时,它解释器负责把\xe7这四个字符,理解为二进制的e7
    unknown authored and unknown committed Feb 23, 2016
    Configuration menu
    Copy the full SHA
    bc159a7 View commit details
    Browse the repository at this point in the history
  6. latin-1 is a direct mapping of bytes 0-255 to Unicode

    characters U+0000 to U+00FF. latin-1 encoding is notable in that it will never produce
    a decoding error when reading text of a possibly unknown encoding. Reading a file as
    latin-1 might not produce a completely correct text decoding, but it still might be
    enough to extract useful data out of it. Also, if you later write the data back out, the
    original input data will be preserved.
    unknown authored and unknown committed Feb 23, 2016
    Configuration menu
    Copy the full SHA
    caa8e98 View commit details
    Browse the repository at this point in the history

Commits on Feb 29, 2016

  1. http://stackoverflow.com/questions/388490/unicode-characters-in-windo…

    …ws-command-line-how/388500#388500
    unknown authored and unknown committed Feb 29, 2016
    Configuration menu
    Copy the full SHA
    632bce5 View commit details
    Browse the repository at this point in the history
Loading