How to use Profilers in Python
When you have performance problems in your Python application, you can use a Profiler to help you.
Step 1: Using cProfile
Your first option is to run …
Read Article →In-depth guides, insights, and best practices for modern software engineering
When you have performance problems in your Python application, you can use a Profiler to help you.
Your first option is to run …
Read Article →Given a non-negative integer, 3 for example, return a string with a murmur: "1 sheep...2 sheep...3 sheep...". Input will …
If you have a CommandLine application (CLI) written in Python, you have a number of ways that you can take arguments from the user.
You could take the …
Read Article →Python provides the ability to create Translation Tables.
our_text = "This is an example of some text"
translation_table = …
Read Article →
Let’s take the following string:
numbers = "this 1 2 3 4 5 is not a 8 9 10"
How can we sum up all the numbers in this string? …
Read Article →Python comes with a very useful module called itertools, which allows us to calculate permutations directly.
from itertools import permutations
perms …
Read Article →
If you are trying to push a Docker image to AWS ECR (Elastic Container Registry) and you get a no basic auth credentials error. Then you can easily …
Let’s take the following sentence:
words = "These are some words"
We can use slices to reverse the order of the string:
print( …
Read Article →
If you get the following error while trying to install something via Homebrew
AttributeError: 'int' object has no attribute 'split' - make: *** …
By default, Docker pushes its images to Docker Hub.
While Docker Hub is a great way to share both your public and private images, you may find the …
Read Article →Welcome to our comprehensive guide on how to python base64 encode a string in Python. …
The random module allows you to generate choices.
import random
print(random.choices([i for i in range(1000)], k=10))
This might give us back …
Read Article →