Python错误: NameError

简介: Python错误: NameError

错误


img_path = raw_input('Input the path and image name:')


执行显示如下:


NameError: name ‘raw_input’ is not defined


原因


raw_input是2.x版本的输入函数,在3.x版本下会报错,应该用input()

相关文章
|
6天前
|
Python
python变量未定义(NameError)
【5月更文挑战第1天】
16 1
|
4月前
|
索引 Python
完美解决丨#在python中,如果引用的变量未定义,则会报告NameError: name ‘变量名‘ is not defined。
完美解决丨#在python中,如果引用的变量未定义,则会报告NameError: name ‘变量名‘ is not defined。
|
10月前
|
算法 IDE 开发工具
【Python语法】类型提示(self, nums: List[int]) -> List[int],报错NameError: name ‘List‘ is not defined解决
【Python语法】类型提示(self, nums: List[int]) -> List[int],报错NameError: name ‘List‘ is not defined解决
|
Python
Python错误:'tuple' object is not callable
Python错误:'tuple' object is not callable
183 0
|
程序员 Python Windows
全网首发:安装Python(或其他软件)出现0x80072f7d错误的解决办法
全网首发:安装Python(或其他软件)出现0x80072f7d错误的解决办法
436 0
|
IDE 测试技术 开发工具
Python(10)错误、调试、测试(下)
Python(10)错误、调试、测试(下)
123 0
|
Python
Python(10)错误、调试、测试(上)
Python(10)错误、调试、测试(上)
101 0
|
数据采集 数据挖掘 编译器
【Python 基础教程】错误与异常的处理
【Python 基础教程】错误与异常的处理
129 0
【Python 基础教程】错误与异常的处理
|
数据安全/隐私保护 索引 Python
【python小白到精通 | 课程笔记】第一章 初识Python(这几个小错误你会犯吗?)
【python小白到精通 | 课程笔记】第一章 初识Python(这几个小错误你会犯吗?)
95 0
|
Python
Python:忽略warning警告错误
Python:忽略warning警告错误
592 0