Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Peter Heitzer" Newsgroups: comp.lang.python Subject: Re: Can I copy/paste Python code? Date: 21 Jul 2015 08:40:28 GMT Lines: 8 Message-ID: References: <0f0c6018-50e7-4e95-a798-313d767ce177@googlegroups.com> X-Trace: individual.net LWfGD7LZwzqPV/hUyWYQIQs2bo5gkNEVrA+MQ1CXO8nqewJb816kYzjeiG X-Orig-Path: not-for-mail Cancel-Lock: sha1:Sczm5RYWAFBq5S03bzRaptCmlcU= User-Agent: tin/2.2.1-20140504 ("Tober an Righ") (UNIX) (Linux/3.16.0-4-amd64 (x86_64)) Xref: csiph.com comp.lang.python:94277 ryguy7272 wrote: >I'm trying to copy some Python code from a PDF book that I'm reading. I want to test out the code, and I can copy it, but when I paste it into the Shell, everything is all screwed up because of the indentation. Every time I paste in any kind of code, it seems like everything is immediately left-justified, and then nothing works. >Any idea how to make this work easily? Without re-typing hundreds of lines of code... try cat >testfile , paste in and type ^D or use a graphical text editor to paste the code in.