Python

Python

Python How to run another Python script with arguments

Another Python script can be run by exec function. However, arguments can't be specified with it. How is it implemented? Okay, use subprocess.call or subprocess.run instead.
Python

Python How do nested groups work for regex

If there are several formats and data need to be extracted from the string, the nested group might neet to be used in the regex string. How does it actually work? Let's check together with me.
Python

Python Convert str to int/float, dict/list to str, and vice versa

Conversion is often needed to change the data type. This post covers main cases where you need in your production code. Let's check how to convert a variable.
Python

Python Access a class property by the name without dot chaining

In some cases, a key string needs to be used to read property. How can it be done in Python? Use setattr, getattr, and hasattr functions
Python

Python How to trim unnecessary letters from a string

Are unnecessary spaces contained in a string? Then, let's trim them by using strip. It can be used not only for spaces but also for arbitrary characters.
Python

Python Use lambda to create a function for simple logic

Using lambda is a good choice if a function requires a callback parameter and the logic in the callback is quite simple. Let's learn how to use it if you don't know it.
Python

Python 4 ways to remove duplicates from an object list

Do you need to remove duplicates from a list? This post covers not only a literal list but also an object list. If it's an object list, it's harder to remove duplicates than the literal version. Let's check how to implement it!
Python

Spread operator in Python? How to unpack list/dict

How can we write if we want to unpack a list in Python? Is there something like spread operator used in JavaScript? Yes. Use an asterisk to unpack the list. Use double asterisk for dict type. Let's look at the examples.
Python

Python How to filter object list

Why doesn't Python provide a method to filter a list? It provides filter class instead. You can use it to filter a list/dict. You can also use basic for-loop to do the same thing. Let's learn how to filter a list in this post!
Python

Python How to create multiple Threads for async

To make multiple tasks asynchronously, it's necessary to know how to create threads in Python. This post shows how to do it.