博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
为什么在CentOS 6上的Python中出现“ ValueError:格式为零长度的字段名称”错误?...
阅读量:2517 次
发布时间:2019-05-11

本文共 801 字,大约阅读时间需要 2 分钟。

The same program runs without any problem while it report

报告相同的程序时没有任何问题

ValueError: zero length field name in format

in Python on CentOS 6

CentOS 6上Python中的

The piece of code in Python is:

Python中的代码片段是:

'== {} SPF'.format(d)

Why “ValueError: zero length field name in format” error in Python on CentOS 6?

为什么在CentOS 6上的Python中出现“ ValueError:格式为零长度的字段名称”错误?

This feature of {} without the position argument specifier is only available after at least 3.1 for Python 3, or 2.7 for Python 2.

没有位置参数说明符的{}此功能仅在Python 3至少为3.1或Python 2至少为2.7之后可用。

On CentOS 6, the default Python version is 2.6:

在CentOS 6上,默认的Python版本是2.6:

$ python --versionPython 2.6.6

So you need to add the position argument specifiers:

因此,您需要添加position参数说明符:

print '== {0} SPF'.format(d)
Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。

翻译自:

转载地址:http://cfowd.baihongyu.com/

你可能感兴趣的文章
android windows 上JNI编程
查看>>
PHP中可变变量到底有什么用?
查看>>
谈一谈最近关闭的Kindle人论坛
查看>>
mysql 常用命令行
查看>>
PDF.NET数据开发框架 之SQL-MAP使用存储过程
查看>>
如何用eclipse运行导入的maven项目
查看>>
svn服务器安装
查看>>
arya使用流程
查看>>
最近要做的事
查看>>
maven 常用命令
查看>>
Hive-ORC文件存储格式(续)
查看>>
init()和onEnter()方法的区别
查看>>
Android_三种菜单介绍
查看>>
js常用方法之String对象方法扩展
查看>>
sqlserver 三大范式
查看>>
摄像机放缩控制的代码 转来看看的
查看>>
PAT_A1051
查看>>
关于设计:Actionscript 有关鼠标事件笔记
查看>>
Android之SurfaceView学习(一)
查看>>
lombok常见注解
查看>>