Thanks that was helpful but I have used csv module to import query from csv file
import csv with open('path/learning/python/query/work_phone.csv', newline='\r\n') as myFile: reader = csv.reader(myFile) for row in reader: print(row)