Ubuntu 16.04 lts Source code installation Python 3.6.0 tutorial

Source: Internet
Author: User
Premise

The website provides the installation package on MAC and Windows and the required source code for Linux installation.

The download address is as follows:

https://www.python.org/downloads/release/python-360/

Installation

wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xzxz-d PYTHON-3.6.0.TAR.XZTAR-XVF PYTHON-3.6.0.TARCD Python-3.6.0./configuremakesudo make Install

Test:

$ python3.6--versionpython 3.6.0

To test several new syntax features:

1.

# formatted string literals>>> name = ' Ray '    >>> f ' Hello {name}. ' Hello Ray. '

Effect is equivalent to

>>> name = ' Ray ' >>> ' Hello {name}. ' Format (name=name) ' Hello Ray. '

2.

# underscores in Numeric literals>>> a = 1_000_000_000_000_000>>> a1000000000000000>>> ' {: _} '. Format (1000000) ' 1_000_000 ' 1_000_000 '

3.

# enum.auto>>> from enum import enum, Auto>>> class Color (enum): ... red = auto () ... blue = auto () ... gre En = auto () ...>>> list (Color) [<color.red:1>, <color.blue:2>, <color.green:3>]

Tips

After the first compilation of the installation, it is possible to find that the arrow keys fail after the input python3.6.

The reason is that the ReadLine library is not installed.

How to resolve:

Installing the ReadLine Library

sudo apt-get install Libreadline-dev

Once installed, then recompile the Python installation once.

CD Python-3.6.0./configuremakesudo make install

Summarize

The above is the entire content of this article, I hope that the content of this article on everyone's study or work can bring some help, if there are questions you can message exchange.

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.