This is a Python Question (not Django) How are you populating cr? Did you check if there are any rows at all before looping over the rows?
Regards, Anurag On Fri, Mar 18, 2011 at 12:07 AM, NavaTux <[email protected]> wrote: > Here I ahd a piece of code to execute my custom python function > > just i executed via python shell ,so i used print statement to know some > values but it does't respond anything > May i know the reason please? > this is the code which i executed successfully > ">>> for i in cr: > ... tic, mktprice,exp_date, e, ep, c, cp = i > ... expd = datetime.strptime(exp_date, "%Y-%m-%d %H:%M:%S") > ... cd = datetime.combine(datetime.now().date(), > datetime.time(datetime(12,12,12,0,0,0,0))) - timedelta(days=8) > ... datediff = expd - cd > ... current_date = cd.strftime("%Y-%m-%d") > ... days_to_expiry = datediff.days > ... mktprice, e, ep, c, cp = float(mktprice), float(e), float(ep), float(c), > float(cp), float(s), float(sp) > ... print days_to_expiry > ... print mktprice > ... >>>> > > cr is the data that red from csv file.So i is the row from a csv file > why it doesn't print anything? > it is just a simple python part > " > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

