Back to categories

Category: "Python"

Define a Python Script Inside a GH Actions Workflow File Janne Kemppainen |

GitHub Actions gives you lots of freedom to define custom workflows by combining different actions and running command line programs. Sometimes you might want to run small snippets of code, and that is already possible by running scripts from the command line with the run keyword. What if you could write your Python script inside the workflow YAML file instead?

Dynamic Attributes in Python Janne Kemppainen |

When you define an object in Python you usually give it some attributes that hold the necessary pieces of information in a place that makes sense. However, Python does not limit the use of attributes to the set that were described at object creation time.

Chained Comparisons in Python Janne Kemppainen |

Can you chain comparison operations in Python? Yes you can, each comparison is evaluated pairwise so you can chain together as many of them you want.

It can be easy to forget to use basic features like this if you come from a language that doesn't support chained comparisons or if you've never seen them used in the wild. I've been using Python professionally for years but I have to admit that I still didn't really know about this feature until recently.

Create Simple Python GUI Applications with Gooey Janne Kemppainen |

This time I'm going to show you how to create simple GUI applications in Python using a package called Gooey. It lets you turn (almost) any command line Python application into a GUI application with one line.

Create Your Own Python Packages

From programming to publishing

Janne Kemppainen |

When programming in Python you're used to installing packages from the Python Package Index (PyPI). But how do the packages end up there? How can I make my Python code installable? Let's find out!

Backend With Python, How? Janne Kemppainen |

You want to be a Python backend developer but have no idea what you should learn? Choosing what to focus on can be difficult. In this blog post I hope to help you by discussing different types of backends and the technologies that you could use to build them.

Building URLs in Python Janne Kemppainen |

Building URLs is really common in applications and APIs because most of the applications tend to be pretty interconnected. But how should we do it in Python? Here's my take on the subject.

Use Google Analytics to Show Popular Content on Your Static Blog Janne Kemppainen |

It is quite easy to recommend your most popular posts to your readers if you are running a WordPress site. What if you are using a static site generator such as Hugo instead? On this post you'll learn how to add a popular posts section by using data from Google Analytics, and how to automate the whole process.

What is the Switch-Case Equivalent in Python? Janne Kemppainen |

The Python syntax doesn't have the switch-case statement. So what is the equivalent in Python? That's what we'll talk about in this post.

Dockerize Your Python Applications (Flask example) Janne Kemppainen |

Nowadays Docker containers seem to be all around us. With the rise of Kubernetes they are now even more relevant in businesses that choose to run their processes in public or private clouds.

Another trending thing in the development world is Python which is especially huge in the machine learning field. In this post I'll show you how to containerize your Python application in just a few minutes.