Beautiful-ugly/explicit-implicit Let’s start with beauty. They say beauty is in the eye of the beholder. And this is why, when you behold improperly indented code, you begin to understand the beauty of actually indented code. Here is the same code written correctly in JavaScript and Python: const value = 5; for (let i = 0; […]
Flat-nested/sparse-dense – Talking about Python
Flat-nested/sparse-dense The part about flat being better than nested, in particular, is a reason for those famous one-line Python codes that you see. Simple code shouldn’t have to span across 20-30 lines when it can be done in a few. In a lot of languages, it cannot be done in a few lines, but in […]
Ambiguity/one way/Dutch – Talking about Python
Ambiguity/one way/Dutch Anyone who has ever worked with clients knows how demoralizing and frustrating a vague requirement is. “Do this, do that, we need this” – that’s all you hear, without any understanding from the other side or respect for how the process works. They have a certain goal in mind, and they don’t care […]
Now or never – Talking about Python
Now or never This is another one of those principle pairs that is more about the method of writing than the writing itself. The statements of now being better than never but never being better than right now may seem somewhat paradoxical, but they describe the nature of writing code and delivering value through it. […]
Namespaces – Talking about Python
Namespaces The lone zen, namespaces are just import statements written in ways that don’t cause conflicts. In this example, there are two libraries, lib1 and lib2, both containing methods named example. What would be the solution that allows both of the methods to be imported into one Python file? You can just change one or […]
Containerization – Talking about Python
Containerization Containers are made using the Docker library. The creation, destruction, and modification of containers can be automated and orchestrated using Python. It provides a way to programmatically maintain and modify container states. Some applications include the following: You may be wondering what the point of containers is, and that may be because you’ve never […]
A couple of simple DevOps tasks in Python – Talking about Python
A couple of simple DevOps tasks in Python I have so far preached to you the virtues of DevOps and the virtues of Python but so far, I have shown you very little of how the two work together. Now, we get to that part. Here, I will demonstrate a couple of examples of how […]
A couple of simple DevOps tasks in Python 2 – Talking about Python
2. Next, you will either have to create an execution role for the Lambda function or give it an existing one. This will be important later. But for now, do the one you prefer. Click Create function to create your new blank canvas. The reason we are using the AWS environment for the microservices to […]
Autopull a list of Docker images – Talking about Python
Autopull a list of Docker images Grabbing Docker images can be tedious. Especially grabbing multiple images. So now, we are going to see how we can pull a number of Docker images at the same time using the Python library for Docker: pip install docker 2. Then, write a script in a file called docker_pull.py […]