标签:ini imp iar item collect generate att port ica
The Python Standard Library has a lot of modules! To help you get familiar with what‘s available, here are a selection of our favourite Python Standard Library modules and why we use them!
csv
: very convenient for reading and writing csv filescollections
: useful extensions of the usual data types including OrderedDict
, defaultdict
and namedtuple
random
: generates pseudo-random numbers, shuffles sequences randomly and chooses random itemsstring
: more functions on strings. This module also contains useful collections of letters like string.digits
(a string containing all characters with are valid digits).re
: pattern-matching in strings via regular expressionsmath
: some standard mathematical functionsos
: interacting with operating systemsos.path
: submodule of os
for manipulating path namessys
: work directly with the Python interpreterjson
: good for reading and writing json files (good for web work)
How to import:
from module_name import object_name as different_name
for example:
from csv import reader as csvreader
标签:ini imp iar item collect generate att port ica
原文地址:http://www.cnblogs.com/Answer1215/p/7910360.html