I'm using a python script to convert text file into csv and i want to call that python script from php to export those data into the data base.how can i call this python script from php ? the name of my python file is convertcsv.py. this is my python code
import csv
csv_file = r"mycsv.csv"
txt_file = r"newtext.txt"
lines = open( r"mytext.txt").readlines()
open(txt_file, 'w').writelines(lines[14:-1])
in_txt = csv.reader(open(txt_file, "rb"), delimiter = ',')
out_csv = csv.writer(open(csv_file, 'wb'))
out_csv.writerows(in_txt)
i need to call above python file from php and when calling this csv file should be created.this is working fine in python.