Learning Python.

For fun, I’ve been working my way through this book, slowly but surely. It’s a good resource for me, although I wouldn’t recommend it as a general learning resource; its poor writing and pacing mean that I need to struggle and research to find out what the heck the book is intending me to do.

And I have learned many lessons so far!

  • Python uses space-based indents for formatting. Unlike sane languages that use parenthesis and disdain whitespace-based delination to the Outer Void, Python cares deeply about the right number of four-space indents.
  • Notepad++, my text editor of choice, will helpfully or auto-‘correct’) four spaces into tabs.
  • Python disdains tabs as not the One True Delineation Standard.
  • The PDF version of the book I have doesn’t actually let you copy code examples out of it without stripping out the newlines, meaning you need to then go back in and manually format each line to end in the right place, and to ensure that you didn’t break any of the indent spacing in the process.
  • The Windows console command ‘print’ has been broken for generations; if you need a replacement for UNIX-style ‘cat’, you can use ‘type’. (And on that note, one of the things I do like about Windows 10 is that the shell is decent at using pipes finally.)

My overall experiences with Python initially are…well, you got them. It’s competent at what it sets out to do, but return as statement terminator and number of spaces as depth parser mean that it’s a genuine bitch to move code around. I know damn well that the problem I’m having copying code out of this PDF will happen to anyone unfortunate enough to carelessly FTP a Python script from a UNIX box to a Windows box without accounting for it.

On the plus side, I’m not at the level of mastery where I’m about ready to start running Python scripts to attempt to reformat the results of copy-pasting out of the PDF.

More later.


Single Post Navigation

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: