1

I'm trying to test some Python code using the Python interpreter, via the Windows Anaconda Prompt. The problem is, when I copy/paste code from my text editor into the prompt, all the newlines disappear and it just becomes one very long line of text.

I've verified that the copying isn't an issue. If I copy from my text editor (Atom) and paste into Notepad, it will preserve the newlines. The issue only comes up if I try to paste into the REPL.

Original:

enter image description here

Pasted:

enter image description here

wheeeee
  • 1,046
  • 2
  • 14
  • 33
  • If you use IPython, you can copy from Atom with CTRL + C and then in IPython type (literally) `%paste` to have it paste with newlines and indentation preserved – darthbith Apr 25 '20 at 14:32
  • Please do not share information as images unless absolutely necessary. See: https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors, https://idownvotedbecau.se/imageofcode, https://idownvotedbecau.se/imageofanexception/. – AMC Apr 27 '20 at 04:10
  • Also, are you certain that this is specific/particular to Conda? – AMC Apr 27 '20 at 04:12
  • 1
    Does this answer your question? [Pasting multiple lines into IDLE](https://stackoverflow.com/questions/1615379/pasting-multiple-lines-into-idle) – AMC Apr 27 '20 at 04:12
  • @AMC I don't think a screenshot here is problematic, since this is not a code snippet, just a visual example. Thanks for linking the other question, but that user is having a different problem altogether. That user is capable of pasting their code into multiple lines, but their interpreter cannot execute any line beyond the first. – wheeeee Apr 28 '20 at 20:09

0 Answers0