Skip to content

Category: Python

Executing shell commands with Python

When working with Python, there may be times when you need to execute shell commands directly from your Python code. This can be particularly useful for automating tasks, managing system […]

Writing to files with Python

Python provides several ways to write data to a file, including using the built-in open() function and the with statement. In this article, we’ll cover how to write to a […]

Reading and Writing XML Files in Python with Pandas

XML files are a common data format used for exchanging data between different systems. Python provides several libraries for parsing and manipulating XML files, including the popular xml.etree.ElementTree module. In […]

How to Work with PostgreSQL in Python?

PostgreSQL is a popular open-source relational database management system. It offers many advanced features and is widely used in production environments. Python is a powerful programming language that is also […]

Convert wav to mp3 format in Python

Learn how to convert an audio file from wav format to mp3 format in Python. Pydub is a Python module that can be used in Audio manipulation. pydub can be […]

Check if variable exists in Python

How to check if a variable exists in Python ? Python doesn’t have a specific function to test whether a variable is defined, since all variables are expected to have been defined before use, even if initially assigned the None object. The […]

Sending email in Python

How to send email in Python? There are many ways to acheive this: smptlib, sendmail or even Gmail SMTP port can be used. Read on to know how. smtplib The smtplib is […]

Install Python 3.8 on Ubuntu

Python 3.8.0 is the newest major release of the Python programming language, and it contains many new features and optimizations. This tutorial helps you install Python 3.8 on Ubuntu. Major […]

How to print in same line in Python?

One annoying thing about print() function is, it automatically prints a newline ‘\n’ at the end of the line! print() function was added in Python 3. Until Python 2, print() […]

How to get hostname in Python?

There are a few different ways to get the hostname of a system in Python. The socket module in Python gives access to the BSD socket interface. It is accessible […]

How to generate random numbers in Python?

Randomness plays an important role in the evolution of machine learning algorithms. Python defines a set of functions that are used to generate or manipulate random numbers. This particular type […]