CentOS Preliminary Learning Record (eight) Python + Shell

Source: Internet
Author: User

Tag: INF suffix to perform learning shel STD high cost performance Program advanced

First, preface

Python is a high-level programming language for interpreting, object-oriented, and dynamic data types.

    1. Many shell scripts can't handle or handle inconvenient things python can do
    2. Python code is simple, simple to configure, various open source Escudo
    3. High efficiency, high cost performance
Second, download the installation

Official website: https://www.python.org

2.1 Decompression

1) XZ

XZ is a lossless data compression file format using the LZMA compression algorithm (high compression rate)

XZ-D file. xz      -z file         # forced compression

2) Tar

tar zcvf file. Tar . GZ    # Package folder or file tar zxvf file. tar. GZ    # Unzip

File suffix if no. gz means that no gzip compression is used, just remove the parameter z of the TAR command

2.2 Installation

Enter the Python source directory:

./configure

The script Configure is used to generate makefile, which itself is generated by the autoconf software.

 Make  Make Install

Compiling and installing

2.3 First Python Program
1 #!/usr/bin/python2 ImportSYS3 Print '---'+sys.platform+'---'4 Print 'Please input your name:'5Get_str =Sys.stdin.readline ()6 Print 'Hello,'+get_str

First line: interpreted by Python on behalf of the file execution

Second line: Represents the introduction of system-related information module SYS

Third line: The operating system environment that represents the output run

Line five: Represents a line read from a standard input

Execution Result:

CentOS Preliminary Learning Record (eight) Python + Shell

Related Article

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.