So one of my “projects” … and if you’re like me you have about 10 of them going on technology wise at any given point… is to learn Python. I wanted to share a resource that’s been invaluable so far in helping me learn. It’s a book by Erik Matthes called “Python Crash Course” “A Hands on Project Based guide to learning”
It gets right down to business, which is important for someone like me with the attention span of a flea. I have a laundry list of scripting languages I’m interested in learning, and this book might just help me achieve that goal for one of them. Hope it helps you!
Learning Python has been on my todo list for years… never gotten around to it… Need a solution that can be solved in Python… I mostly just automate in bash where I need to automate something…
Dabbled a bit in Puppet, and Ansible…
There was a time 5ish or so years ago where ALL jobs in my field (Linux admin) were devops and they wanted a Python guru… Got a permanent gig with a big managed service provider in 2018 doing old school “infrastructure” and haven’t looked back since…
I guess I should get my feet wet - might check that book out…
I always read about people who couldn’t get used to the white space thing in Python.
Coming from a COBOL background it looks completely normal to me. I can’t imagine what some people must code like. We were trained in school and then required by the company we worked for to use that same indentation and white space for readability.
What is your programming background and did you think the white space looked funny?
When doing Fortran on punched cards the whole idea was to cram out all white space to
save card columns. So I grew up without white space
Then when structured programming came in , I had to learn to indent and space. It did not bother me either way.
It depends on the language. Indenting helps C and Pascal a lot more than Fortran. I could still live with fixed format Fortran today… there is heaps of it around.
Today just came across UNIX being unhappy about config files with spaces instead of tabs, in Solaris (10) the /etc/syslog.conf file must have TABS separating fields, NOT spaces! And it also hates it when you try to plonk in an asterisk… OK - fixed that on 1 Solaris instance, only another 90 or so to go - and Ansible is borked on Solaris 'cause of Python! Oh Joy! Rapture! Half of them have bash misconfigured so there’s no shell history either! Joy! Rapture!
So, Python was actually the first programming language I learned, then the next one was C# (which is what I use most of the time at my job, although the last few weeks its been all PowerShell). In the beginning, that white space thing was very helpful, and it taught me a lot about making your code readable. Now, though, I do find it to be a bit tedious that the damn thing won’t run if the white space isn’t just right. White space is always good for readability, but I prefer it when it isn’t required by the language. When the white space is wrong in Python or YAML, it doesn’t necessarily make it any harder to read, for example.
So I guess I would say that the white space should always be suggested but not required. Of course, I don’t expect YAML or Python or any of those other languages that enforce white space to make any changes for my sake.