将多行代码段粘贴到IPython中

时间:2012-04-19 14:55:51

标签: python ipython multiline paste

我过去使用过IPython,过去我曾经能够复制和粘贴多行命令,例如IPython中的for循环。在安装Python(x,y)2.7.2.1之后在我的新PC中工作,我可以使用右键单击→编辑→粘贴而不是使用 CTRL来粘贴多行片段 + P ,就像我以前那样。使用 CTRL + P 时,只会粘贴多行代码段的第一行。有人可以帮忙吗?我查看了设置和文档无济于事。

2 个答案:

答案 0 :(得分:13)

在IPython命令行中键入%paste。

答案 1 :(得分:8)

您可以将$query = DB::table('properties as pr') ->where("condition " : "? ") ->whereOr("condition " : "? ") ->where("condition " : "? ")->get() 与IPython shell一起使用(这也是Django管理shell使用的)。如果您想了解更多功能,请输入%cpaste

相关问题