Skip to main content

Reading CSV File using Python

In our Python tutorial, you have learned how to write CSV file in Python. In this tutorial, you will learn how to read CSV File in Python.

CSV (comma-separated values) file is a delimited text file. The file consists of one or more lines of data record. Each data record consists of values separated by commas, all the lines of a CSV file have the same number of values.

Here in this tutorial, we will implement how to read a CSV file to get file data. We will use csv module from Python to read CSV file. (more…)

Writing an Excel File in Python

In our previous Python tutorial, you have learned how to Reading an Excel File in Python. In this tutorial, you will learn how to Write an Excel File in Python.

The Excel spreadsheet is a popular file type that lets to create, view, edit, and share your files with others quickly and easily.

In this tutorial, we will use Openpyxl module from Python to wrting to an Excel file with extension such as (xlsx/xlsm/xltx/xltm). The Openpyxl module allows to read and write Excel files. (more…)

Read and Write JSON to File in Python

In our previous Python tutorial, you have learned how to convert string data into JSON in Python. In this tutorial, you will learn how to Read and Write JSON data to a File in Python.

JSON (JavaScript Object Notation) data is an easy-to-read, flexible text-based format that can save and communicate information to other apps. Python has build-in JSON module that accept a JSON string and convert into a dictionary.

Pyhton has open() method to open file and return its object. So let’s proceed to write json data to a file and read json data from a file. (more…)