Beginners First chapter: Python Installation

Source: Internet
Author: User

Python is an interpreted, object-oriented, dynamic Data type high-level programming language!

Python is automatically installed in the general system and can be used to view version information directly with the python command! If not installed can be installed directly with the following command!

[[email protected] ~]# Yum install-y python/If not installed on the PC, you can install it directly

can also be installed with the source package, we can write a shell script, directly installed:

#!/bin/bashcheck_ok () {if [ $? != 0 ];thenecho  "Error,please check it  now  "exit 1fi}#### #源码包安装pythoncd  /usr/local/srcif rpm -qa python;then         rpm -e python         wget https://www.python.org/ftp/python/2.6.6/Python-2.6.6.tgz         check_okelse        wget https://www.python.org /ftp/python/2.6.6/python-2.6.6.tgz        check_okfi         tar zxvf Python-2.6.6.tgz         cd python-2.6.6        ./configure --prefix=/usr/local /python        check_ok         make        make install        check_ok         ln -s /usr/local/python/bin/python2.6  /usr/bin/ python  /If the computer has been installed Python, run this step, may be error, can be ignored directly, no impact!         check_ok

Next, simply write a python script:

[Email protected] ~]# PYTHON-V/Note This is capitalized "V" view version number Python 2.6.6 write a python script [[email protected] ~]# vim hello.py /python script with. py suffix, pay attention to the habit #!/usr/bin/env python/Note the starting line, unlike the shell script print ' Hello World ' ~[[email protected] ~]# p Ython hello.py/Run Python script Hello World


This article is from the "Custom" blog, so be sure to keep this source http://zidingyi.blog.51cto.com/10735263/1726728

Beginners First chapter: Python Installation

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.