zoukankan      html  css  js  c++  java
  • [Python] Python Libs

    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 files
    • collections: useful extensions of the usual data types including OrderedDictdefaultdict and namedtuple
    • random: generates pseudo-random numbers, shuffles sequences randomly and chooses random items
    • string: 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 expressions
    • math: some standard mathematical functions
    • os: interacting with operating systems
    • os.path: submodule of os for manipulating path names
    • sys: work directly with the Python interpreter
    • json: 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
  • 相关阅读:
    计算机基础(7)
    计算机基础(6)
    计算机基础(5)
    计算机基础(4)
    计算机基础(3)
    计算机基础(2)
    计算机基础(1)
    数组、函数
    js基础知识
    随笔3
  • 原文地址:https://www.cnblogs.com/Answer1215/p/7910360.html
Copyright © 2011-2022 走看看