Post by ryguy7272
I'm just learning Python. It seems like indents are EXTREMELY important. I guess, since there are no brackets, everything is controlled by indents. Well, I'm reading a couple books on Python now, and in almost all of the examples they don't have proper indents, so when I copy/paste the code (from the PDF to the IDE) the indents are totally screwed up. I'm thinking that there should be some control, or setting, for this. I hope. :)
That probably depends on the person who made the PDF. You may simply
have to copy and paste one line at a time; if you're using an editor
that understands Python syntax, it'll do some of your indenting for
you, and you'll just have to manually mark the unindents.
Alternatively, just paste it all in without indentation, then go
through and select blocks of code and hit Tab; in many editors,
that'll indent the selected code by one level. But ultimately, the
fault is almost certainly with the PDF.