[Ilugc] Doubt in python

  • From: hariprasadh89@xxxxxxxxx (hari prasadh)
  • Date: Tue, 5 Nov 2013 15:44:05 +0530

As iam new to python,please help here.


[root at 10 ~]# cat /tmp/acess_Nov5_1.csv

"1","88"

"1","89"

"1","95"





import csv

ifile  = open('/tmp/acess_Nov5_1.csv', "rb")

reader = csv.reader(ifile)

dict={88:'c2process',89:'riskmgmt',95:'portal'}

for i in reader:

...     print "dict["+i[1]+"]"



Reading the file values as list.Need to pass the list values of the file to
the dictionary as a key to fetch the value of the dictionary.




-- 
Thanks & Regards,
HariPrasadh

Other related posts: