How to Get File Size in Python?

Get File Size in Python 3

I recently faced an issue where I needed to retrieve the size of a file. After researching and testing various methods, I discovered several effective ways to accomplish this task. In this tutorial, I will explain how to get file size in Python and I will share my findings and provide you with detailed examples … Read more >>

How to Overwrite a File in Python?

Overwrite a File in Python

Recently in a Python webinar, someone asked me how to overwrite a file in Python. After researching and experimenting I found two effective ways to achieve this task. In this tutorial, I will explain the important methods with suitable examples and screenshots. Let’s learn more about this topic today. Overwrite a File in Python Overwriting … Read more >>

How to Rename Files in Python?

Rename Files in Python

As a developer, while working on a project I came across a situation where I needed to organize a large collection of files and change the name of a single file, Python provides a simple way to accomplish this task. We’ll explore various methods, from the simplest to more advanced techniques. In this tutorial, I … Read more >>

How to Check if a File is Empty in Python?

Check if a File is Empty in Python

In this tutorial, I will explain how to check if a file is empty in Python. I recently faced this issue while building a data processing pipeline for a client in New York, where I needed to ensure that the input files were not empty before feeding them into the system. Let us explore different … Read more >>

How to Get File Name Without Extension in Python?

Get File Name Without Extension in Python

In this tutorial, I will explain how to get file name without extension in Python. As a Python programmer, we get various situations to work with files and it is important to know how to get a file name without extension. I will explain four important methods to achieve this task with examples. Get File … Read more >>

How to Write Multiple Lines to a File in Python?

Write Multiple Lines to a File in Python

As a data scientist working on various projects across the USA, I came across a scenario where I needed to write multiple lines to a file in Python. After exploring more on this topic I found several methods to accomplish this task. Let us learn more about writing multiple lines to file with examples. Write … Read more >>

How to Write Lines to a File in Python?

Write Lines to a File in Python

In this tutorial, I will explain how to write lines to a file in Python. As a Python developer working on a project for one of my clients, I came across a scenario where I needed to write lines to a file in Python. After researching I found some important methods to achieve this task. … Read more >>

How to Clear a File in Python?

Clear a File in Python

In this tutorial, I will explain how to clear a file in Python. Someone raised a question about clearing a file in Python in a webinar, which made me explore more about this topic and while researching I found four efficient methods to achieve this task. I will explain all the methods with examples and … Read more >>

How to Read XML Files in Python?

Read XML Files in Python

In this tutorial, I will explain how to read XML files in Python. As a developer working on a project, I came across a scenario where I needed to read XML. I explored various ways to accomplish this task and will share my findings with suitable examples. XML Structure Before getting into the code, let’s … Read more >>

How to Skip the First Line in a File in Python?

Skip the First Line in a File in Python

In this tutorial, I will explain how to skip the first line in a file in Python. As a developer working on a project for one of my New York clients, I came across a scenario where I needed to skip the first line in the file while processing CSV files and text files. After … Read more >>

51 Python Programs

51 PYTHON PROGRAMS PDF FREE

Download a FREE PDF (112 Pages) Containing 51 Useful Python Programs.

pyython developer roadmap

Aspiring to be a Python developer?

Download a FREE PDF on how to become a Python developer.

Let’s be friends

Be the first to know about sales and special discounts.