输入()IPython和Jupyter QtConsole之间的差异

时间:2016-07-23 01:25:16

标签: python python-2.7 ipython jupyter nameerror

IPython的:

>>> a = 5
>>> print input()
a
>>> 5

Jupyter QtConsole:

>>> a = 5
>>> print input()
a
  

----------------------------------------------- ---------------------------- NameError Traceback(最近一次调用   最后)in()   ----> 1输入()

     

C:\ Anaconda2 \ lib \ site-packages \ ipykernel \ ipkernel.pyc in   (提示)       163 self._sys_eval_input = builtin_mod.input

     

164 builtin_mod.raw_input = self.raw_input - > 165 builtin_mod.input =   lambda prompt ='':eval(self.raw_input(prompt))166 self._save_getpass   = getpass.getpass 167 getpass.getpass = self.getpass C:\ Anaconda2 \ lib \ site-packages \ ipykernel \ ipkernel.pyc in()

     

NameError:name' a'未定义

有人能解释一下发生了什么吗?

0 个答案:

没有答案