how to compare: a file from excel and some text in python -


i have homework have complete before holidays- it's stressing me out. trying consists of me making program in python takes in vehicle number plate. if vehicle number plate matches 1 of plates in excel file, print out details specific vehicle number plate. so, need python program read excel file, compare text entered in python shell , print out vehicle number plate excel file. bet simple code have been struggling task while, if me, happy :). here i've done far: hope have written makes sense

here's example of wrote in code:

import filecmp  import csv  v_n_p = input("enter vehicle number plate: ").lower()  if v_n_p == "hs16sri":     f = open('test.xls')     filecmp.cmp(cola, (v_n_p))     cola = (0,1)     print (cola) else:     print (" ") 

from have can try point right direction. first of all, importing csv, presume save xls file csv , open it. input fine, check specific case of input. input has hs16sri, in order program anything. program should open file right after plate number has been entered. second, make loop goes through in test.xls(which should csv?) going through mean every row , column, since not know structure of input file can recommend.

if provide little more detail maybe can more, keep in mind homework assignment , should not doing you not learn :)

-use understand how parse csv: https://docs.python.org/2/library/csv.html

-you might want use library if have keep excel file: http://www.python-excel.org/


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -