在 Ubuntu 16.04 LTS 上安装 Python 3.6.0
        【摘要】 
                      
  
原文连接:https://segmentfault.com/a/1190000007912666 
  
  
最近 Python 3 发布了新版本 Python 3.6.0,好像又加入了不少黑魔法!~ 
 
 由于暂时不能使用 apt-get 的方式安装 Python 3.6,所以还是直接编译源码安装吧。
 
 
 
官网...
    
    
    
    
 
 
原文连接:https://segmentfault.com/a/1190000007912666
 
 
最近 Python 3 发布了新版本 Python 3.6.0,好像又加入了不少黑魔法!~
官网上提供了 Mac 和 Windows 上的安装包和 Linux 上安装需要的源码。
 
 
https://www.python.org/downlo...
 
安装
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xz
xz -d Python-3.6.0.tar.xz
tar -xvf  Python-3.6.0.tar
cd Python-3.6.0
./configure
make
sudo make install$ python3.6 --version
Python 3.6.01
# Formatted string literals
>>> name = 'Ray'                                    
>>> f"Hello {name}."       
'Hello Ray.'效果相当于
>>> name = 'Ray'       
>>> "Hello {name}.".format(name=name)
'Hello Ray.'# Underscores in Numeric Literals
>>> a = 1_000_000_000_000_000
>>> a
1000000000000000
>>> '{:_}'.format(1000000)
'1_000_000''1_000_000'# Enum.auto
>>> from enum import Enum, auto
>>> class Color(Enum):
...     red = auto()
...     blue = auto()
...     green = auto()
... 
>>> list(Color)
[<Color.red: 1>, <Color.blue: 2>, <Color.green: 3>]Tips
sudo apt-get install libreadline-dev
 
安装之后,再将 python 重新编译安装一次
 
cd Python-3.6.0
./configure
make
sudo make install 
文章来源: dreamlife.blog.csdn.net,作者:DreamLife.,版权归原作者所有,如需转载,请联系作者。
原文链接:dreamlife.blog.csdn.net/article/details/53883394
        【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
            cloudbbs@huaweicloud.com
        
        
        
        
        
        
        - 点赞
- 收藏
- 关注作者
 
             
           
评论(0)