python 一些模块复习

python 一些模块复习

requests

urllib2

re

data

datetime

url.parse

struct


In [1]: import struct
In [2]: struct.pack("i",1)
Out[2]: '\x01\x00\x00\x00'
In [3]: struct.unpack("i",_)
Out[3]: (1,)

In [4]: s = struct.Struct("i")
In [5]: s.pack(1)
Out[5]: '\x01\x00\x00\x00'
In [6]: s.unpack(_)
Out[6]: (1,)

Loading Disqus comments...
Table of Contents