[Tutor] Program gets stuck after a creating a list from dictinary items!

Alan Gauld alan.gauld at btinternet.com
Fri Jul 6 21:57:05 CEST 2012


On 06/07/12 18:21, Ali Torkamani wrote:
> I'm using Python 2.7.
> By stuck I mean, does not pass that specific line (but no errors).
>

How do you know that is the line it is stuck on?

def WriteOneDayToCSV(sCommonFeatures,sOtherFeatures,date):
     FD=FlatData[date]
 
A=['UniqeDate','Year','Month','Day']+list(sCommonFeatures)+list(sOtherFeatures)
     pdb.set_trace()
     with 
open(str(date.year)+"_"+str(date.month)+"_"+str(date.day)+".csv",'wb') 
as myfile:
         fout = csv.writer(myfile, delimiter=',', quotechar="'")

         fout.writerow(A)
         for prog in FD:
             D=[prog[key1] for key1 in sCommonFeatures]

How do you know its not one of the lines above?

Also what are you using the pdb traces for?
Do they show any output?

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/





More information about the Tutor mailing list