python ways to read file code example
Example 1: python read file
with open("file.txt", "r") as txt_file:
return txt_file.readlines()
Example 2: how to read a file in python
# when you want to read the file from terminal in python use
import sys
f = open(sys.argv[1])
line=f.readline()