Learning python

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”

I’ll link it below for those who are interested :

https://www.amazon.com/Python-Crash-Course-Hands-Project-Based/dp/1593276036

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!

5 Likes

Thanks.

The company I work for has a subscription to O’Reilly and we can read all the books we want for free. Like you my list is long.

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…

1 Like

I’ve tried ChatGPT to write simple stuff and learn … sometimes it gets it, sometimes it doesn’t. lol

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.

1 Like

I did Pascal on punched cards. Part of the grade was having the listing properly indented.

The last project of the first semester my program ran first shot, but one line wasn’t indented properly. I said heck with it, turned it in, and went outside to play some hacky sack and frisbie.

1 Like

White space? What about tabs VS space ?

I usually use tab where I can… I remember some systems spat the dummy if /etc/hosts file had space separators insead of tab chars…

I kinda detest how fussy YAML can be on number of spaces used to indent - drove me batty once with Ubuntu’s netplan NIC settings (Ubuntu server - desktop uses NetworkManager)…

1 Like

Try getting tabs and spaces right in a Makefile.
That sort of thing is why JSON got off the ground.

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 :smiley: - 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!

Its keeping you in a job.
It must be possible to change the code that reads the .conf
file.

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.