Part 3: Email a PDF in Python

Story: This series of articles assume you are an employee of the City of Sacramento’s IT Department. At the end of each month, a CSV file is sent to the Chief of Police outlining the crime statistics for the current month. However, the Chief prefers to view the output in a styled PDF format based … Read more

How to Remove a List Element by Value in Python?

Problem Formulation Given a Python list and an element (value). How to remove the element (value) from the given list? Here’s an example of what you want to accomplish: Given: List [1, 2, 99, 4, 99] Element 99 Return: List [1, 2, 4, 99] An alternative would return the list with the element (value) 99 … Read more

What is Short Circuit Evaluation in Python?

Short circuit evaluation in any programming language — e.g., Python — is the act of avoiding executing parts of a Boolean expression that have no effect on the final result. For example, if you already know that A is False, you can conclude that A and XXX is False no matter what the result of … Read more

How to Escape 9 to 5 as a Python Freelancer?

I vividly remember my first semester studying computer science more than 10 years ago. I knew almost nothing about coding. My uncle, a professional software developer, had quickly shown me the programming language “Visual Basic” and told me something which you may find helpful in your own career: “Learning a programming language is like learning … Read more

Parse JSON Data in Python

Problem Formulation Do you have JSON data that you need to parse using a Python script? Let’s have a look at this JSON data – But when you try to parse this file in your script, you get an exception. Frustrating! Isn’t it? Don’t worry. Most probably you have no errors in your script. The … Read more

CΓ³mo convertir una cadena hexadecimal en un entero en Python

Planteamiento del problema Dada una cadena en forma hexadecimal: CΓ³mo convertir una cadena hexadecimal en un entero en Python Por ejemplo, quieres convertir la cadena hexadecimal ‘0xff’ en el entero decimal 255. AquΓ­ hay otros ejemplos: 0x0 –> 0 0x4 –> 4 0x8 –> 8 0x12 –> 18 0x16 –> 22 0x20 –> 32 0x24 … Read more

Part 2: CSV to PDF

Story: This series of articles assume you are an employee of the City of Sacramento’s IT Department. At the end of each month, a CSV file is sent to the Chief of Police outlining the crime statistics for the current month. However, the Chief prefers to view the output in a styled PDF format based … Read more

How to declare an array in Python?

[toc] Have you been wondering – “How to declare an array in Python?” Well, if your answer is yes, then you are at the right place to find your answers; as in this article, we are going to learn about the different ways of declaring an array in Python. Video Walkthrough A Quick Introduction to … Read more