How to fake a User Agent in Python
A User-Agent is a bunch of text that is sent with every HTTP and HTTPS request. The server processing this request is able to determine what type of …
320 articles about python development, tools, and best practices
A User-Agent is a bunch of text that is sent with every HTTP and HTTPS request. The server processing this request is able to determine what type of …
Use the Linux/Mac tail command to provide the data:
line = subprocess.check_output(['tail', …
Read Article →
As Python developers, we’ve all used pip to install applications, but speaking to other Python developers, it’s not always clear how to …
Sending emails using Python and AWS’ SES service is really easy. They provide an SMTP server that you can authenticate against and send email …
Read Article →Sometimes you may need to read the top n lines of a file using Python.
We start by opening the file for reading and then using a list comprehension we …
Read Article →I operate a bunch of different sites and have done for many years now.
Some of them get quite a lot of traffic and require a high level of uptime.
To …
Read Article →Learning Go or Golang as a Python developer, programmer or software engineer is easier than you think.
While there are quite a lot of things to learn …
Read Article →Let’s say that you have two dates:
"2019-01-29"
"2019-06-30"
How would you create a function that would return the number of …
Read Article →Given a directory that contains:
|
|- app.py
|- requirements.txt
|- ...
|- <- other-files ->
|- ...
We can create a runme.sh file to always make …
Given that we are in a leap year this year (2020), it would be nice to know how to programmatically calculate this.
Luckily, this is a repeatable …
Read Article →It’s important to know about data types and one that comes up fairly regularly is that of Linked Lists.
Let’s write the following base …
Read Article →In this tutorial, we will create a Python application that can be installed directly from pip that will show the 10 latest blog posts from this …