[Ilugc] Doubt in python

  • From: noorul@xxxxxxxxxx (Noorul Islam K M)
  • Date: Tue, 05 Nov 2013 15:55:58 +0530

hari prasadh <hariprasadh89 at gmail.com> writes:

As iam new to python,please help here.


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

"1","88"

"1","89"

"1","95"


Empty lines can cause issues





import csv

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

reader = csv.reader(ifile)

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


Key is integer here.

for i in reader:

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


dict[i[1]] without quotes ??


Regards
Noorul

Other related posts: