8 Topics

Member Avatar for
Member Avatar for Violet_82

Hi guys, I have a question about error handling. Still working on the addition application and now that I've learned what are the correct exceptions to handle I'm not sure what to do when I've established that the my inputs are all valid and print my result. Let's have a …

Member Avatar for Gribouillis
0
413
Member Avatar for renierdbruyn

I have a function that does certain checks, if the the checks fail, it will add values to a dict, i.e: outstanding = {} sims = [_sim for _sim in self.context.sims if unicode(_sim.iccid)] # for sim in [_sim for _sim in self.context.sims if unicode(_sim.iccid)]: print sims count = len(sims) if …

0
131
Member Avatar for sinnebril

Hi, I'm trying to teach myself the Python language with the Google Python class ([url]http://code.google.com/edu/languages/google-python-class/set-up.html[/url]). With the exercise 'wordcount' I get a Traceback error (with the main function and sys.exit(1) function). Even with the solution script (as displayed here). Does anyone recognize this problem and can some one tell me …

Member Avatar for vegaseat
0
976
Member Avatar for biscayne

I'm trying to find a record in a csv file in a nested stucture: for elem in lstLine[1:]: for item in open(fname): lstData = item.rstrip('\n').split(';') andexfield = lstData[0] if andexfield == elem: do bladibla Now I want ot add error handling: if no record in fname is found where andexfield …

Member Avatar for Gribouillis
0
270
Member Avatar for Morten Brendefu

Dear enlighted ones. I happen to try to finsh a kind of a function library that my Main program can utilize. As of now, Everything work great... but. I would like to implement some kind of error handling. The way I do this also work, but the error is generated …

Member Avatar for Morten Brendefu
0
579
Member Avatar for Allison2009

I am handling a wordpress website for a client. It has around 4000 '404 errors'. I am thinking of redirecting it to the home page. But if I redirect, Google should not think that I am duplicating (though I am not doing). The other option is that I can request …

Member Avatar for Allison2009
0
154
Member Avatar for sravanthi89

[CODE]#!/usr/bin/python import smtplib sender = 'from@fromdomain.com' receivers = ['to@todomain.com'] message = """From: From Person <from@fromdomain.com> To: To Person <to@todomain.com> Subject: SMTP e-mail test This is a test e-mail message. """ try: smtpObj = smtplib.SMTP('smtp.gmail.com') smtpObj.sendmail(sender, receivers, message) print "Successfully sent email" except smtplib.SMTPException: print "Error: unable to send email" [/CODE] …

Member Avatar for TrustyTony
0
882
Member Avatar for Smeagel13

I can't decide which route to take when there's a problem. Let me set the scene, User_A creates a recipe, all other users can read it but they cannot modify it. In the edit recipe page, which is accessed via: [INDENT]edit_recipe.php?id={id}[/INDENT] If the user changes the id parameter to a …

Member Avatar for Smeagel13
0
134

The End.