How does IPython's magic %paste work?

前端 未结 6 2177
南笙
南笙 2020-12-07 15:31

I want to copy already indented Python code / whole functions and classes into IPython. Everytime I try the indentation is screwed up and I get following error message:

6条回答
  •  隐瞒了意图╮
    2020-12-07 16:09

    You can't copy to IPython directly. This are the steps:

    1. Copy the lines you want to copy into IPython into the clipboard
    2. Enter %paste into IPython
    3. Press enter
    4. Profit!

提交回复
热议问题