2024-04-26 23:04:19 发布
网友
当我在IPython控制台中键入斜杠时,它返回一个空元组:
In[1]: / Out[1]: ()
为什么会这样?我在mac电脑上。我将Jupyter QtConsole与python3.5.2结合使用。你知道吗
通过键入?并在IPython中读取它:
?
You can force auto-parentheses by using '/' as the first character of a line. For example::In [1]: /globals # becomes 'globals()' Note that the '/' MUST be the first character on the line! This won't work::In [2]: print /globals # syntax error
You can force auto-parentheses by using '/' as the first character of a line. For example::
In [1]: /globals # becomes 'globals()'
Note that the '/' MUST be the first character on the line! This won't work::
In [2]: print /globals # syntax error
所以/本身只是在单词后面加上括号。如果没有消息,你只会得到()。你知道吗
/
()
You can force automatic parentheses by using ‘/’ as the first character of a line.
使用正斜杠添加括号:
/print 1 2 3
相当于:
print(1, 2, 3)
通过键入
?
并在IPython中读取它:所以
/
本身只是在单词后面加上括号。如果没有消息,你只会得到()
。你知道吗使用正斜杠添加括号:
相当于:
相关问题 更多 >
编程相关推荐