[Tutor] need help with a script..
Khalid Al-Ghamdi
emailkgnow at gmail.com
Wed Apr 11 15:50:10 CEST 2012
Hi All,
I'm using python 3.2 on a windows xp.
I wrote the below script and ran it with the hope of returning a list of
proctors (list_proc), but when it runs it doesn't call the function
convert_proctors() as intended. On the other hand, when i import the module
from the IDLE prompt and call the convert_proctors() function, the function
returns the desired list.
Why is this so?
Thanks
1. import csv
2.
3. proctor_file=r'c:\Python32\Khalid Stuff\Testing_Scheduler\p
roctors.csv'
4.
5.
6. def convert_proctors():
7. proctor_csv_reader = csv.reader(open(proctor_file))
8. proctor_list=list(proctor_csv_reader)
9. list_proc=[]
10. for row in range(len(proctor_list)):
11. list_proc.append(proctor_list[row][0])
12. return (list_proc)
13.
14.
15. convert_proctors()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120411/79cc9930/attachment-0001.html>
More information about the Tutor
mailing list