Python Learning Notes-basic "Fifth Week"-Common module learning

Source: Internet
Author: User
Tags file copy

Module Introduction

This section outlines:

    1. Module Introduction
    2. Time &datetime Module (Timing module)
    3. Random (stochastic number module)
    4. OS (System interaction module)
    5. Sys
    6. Shutil (file copy module)
    7. JSON & Picle
    8. Shelve (Package module)
    9. XML processing
    10. YAML processing
    11. Configparser
    12. Hashlib
    13. Subprocess
    14. Logging module

module, which implements a set of code for a function with a mound code.

Like functional programming and process-oriented programming, functional programming accomplishes a function, and other code is used to invoke it, providing reusability of code and coupling between the code. For a complex function, multiple functions may be required to complete (functions can be in different. py files), and the Code collection consisting of N. py files is called a module.

such as: OS is a system-related module; file is a module related to the operation of files

The modules are divided into three types:

    • Custom Modules
    • Built-in standard module (also known as standard library)
    • Open source Module

Open Source Module Distribution Center: pypi.python.org (need to register, you can upload their own module of writing)

Download the installation:

Linux:

There are two ways to download the installation:

yumpipapt-get ...
Way One

Download source code to extract the source code into the directory compiled source    python setup.py build installation source    python setup.py install
Mode two

How to customize a module

Module calls prior to different directories

Reference http://www.cnblogs.com/wupeiqi/articles/4963027.html for the use of custom modules and open source modules

Detailed introduction See http://www.cnblogs.com/alex3714/articles/5161349.html

Python Learning Notes-basic "Fifth Week"-Common module learning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.