Python2.6与Python2.7的format用法区别

Posted 威侠空间

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python2.6与Python2.7的format用法区别相关的知识,希望对你有一定的参考价值。

Python2.6不支持format(123456L, ",")或format(123, ",")的format用法,会报下面的错误

ValueError: Unknown format code ‘,‘ for object of type ‘long‘

 ValueError: Unknown format code ‘,‘ for object of type ‘int‘

Python2.7支持format(123456L, ",")或format(123, ",")

以上是关于Python2.6与Python2.7的format用法区别的主要内容,如果未能解决你的问题,请参考以下文章

python2.6 升级到 python2.7

python2.6.6升级python2.7.14

centos6 升级python2.6 到 python2.7

升级python2.6.6到python2.7导致pip命令不可用

CentOS6.5自带Python2.6.6升级至Python2.7

centos6.5系统自带python2.6升级到python2.7