8 Topics
|
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
[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] … |
|
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 … |
The End.