Do you know how to force keyword arguments, create a function decorator, create anonymous functions, or unpack an array or dictionary into a function’s arguments? Here are four advanced tricks regarding Python functions.
Keyword arguments have several advantages:
Why do we all love Python? For starters, it’s a beautiful and easy-to-learn programming language. Another reason: it comes with batteries included, meaning Python has many excellent libraries included by default. But in my opinion, it’s the 230,000 user-contributed packages that make Python really powerful and popular.
In this article, I handpicked 15 packages that I found most useful during my 10-year career as a Pythonista. Let’s go!
Dash is relatively new. It’s ideal for building data visualization apps in pure Python, so it’s particularly suited for anyone who works with data. Dash is a blend of Flask, Plotly.js, …
I bet you never considered creating a game with Python. But why not? There are awesome libraries that will help you develop games. So let’s help your kids, your partner, or your colleagues get through this crisis with a fun game!
Pygame is a cross-platform set of Python modules designed for writing video games. It includes computer graphics and sound libraries. Here are a few tutorials you can try:
Extended periods of sitting increase your risk of chronic health problems, such as heart disease, diabetes, and cancer. It can also be bad for your mental health.
It’s essential to develop healthy habits as early as you can to counter these risks. I’ll share six crucial tips that helped me improve my health as a software developer.
Sleep is underrated. It’s the foundation of your health. So why do we need it so badly? There are various reasons — these are a few found by scientists:
YAML, a recursive acronym for “YAML Ain’t Markup Language”, is a human-readable data serialization language. It is often used for configuration files, but can also be used for data exchange. The most used python YAML parser is PyYAML, a library that allows you to load, parse, and write YAML, much like Python’s JSON library helps you to work with JSON.
In this article, I’ll share six tricks to effectively and securely use this library. But first, we’ll explore why you should use YAML in the first place.
YAML is easy to write and read for humans, while at the same…
Despite the many libraries on PyPI, sometimes you need to run an external command from your Python code. The built-in Python subprocess module makes this relatively easy.
In this article you will:
A program that is executed on a computer is also called a process. But what is a process, exactly? Let’s define it more formally:
Python is awesome! So why do people hate Python? After some highly non-scientific, Internet-based research, these are the reasons I encountered most often. I found many more, but most of them were so ridiculous that I wouldn’t even dare to repeat them here.
I won’t link to sources or apply naming and shaming. Consider this read just for fun, but with an educational touch!
Disclaimer: no feelings or programmers were hurt while writing this article, but some feelings might get hurt while reading it. If you have a heart condition and love Python, perhaps you better skip this one.
A Bloom filter efficiently tests if an element is a member of a set. It was first proposed by Burton Howard Bloom all the way back in 1970. Although a little unknown, they have become ubiquitous, especially in distributed systems and databases. Bloom filters are an excellent time and memory saver.
After reading this article, you’ll know:
I’ll illustrate with practical Python-based example code. The examples will be so easy to understand that non-Python programmers should have no problem following them.
We’ll dive right in with a…
In this tutorial, we’ll make a discord bot that can play music in the voice channels. Discord is an instant messaging and digital distribution platform designed for creating communities. Users can easily enter chat rooms, initiate video calls, and create multiple groups for messaging friends.
We’ll skip the basics and jump straight over to the music playing part. Check out the following Medium article to catch up on the basics of setting up your bot:
The final result, our bot playing music on the voice channel, will look like this:
When working with code, it’s vital to use a powerful and responsive editor, or better yet, an IDE. A good IDE offers improved code organization, a fluent workflow, and powerful features to make life easier. One such tool is VSCode, created by Microsoft and freely available for anyone to download.
IDE stands for “Integrated Development Environment.” In more human terms, an IDE is a programmer’s playground. Most IDEs are backed by a community of contributors that build extensions for the IDEs. …