On Sat, Oct 10, 2009 at 4:31 AM, Didar Hossain <didar.hoss...@gmail.com>wrote:
> Since I am learning Python, I was wondering if there are any good > references on secure > coding practices. Books, guides or even any howtos would suffice. > I'm not sure of any references, but I know of a few things. First, for versions < 3.0 use raw_input (ref: http://docs.python.org/library/functions.html#raw_input ) It's a lot more secure than input() Data validation is also a good thing: rather than a function like this: def mysum(n1, n2): return n1 + n2 validate your data: def mysum(n1, n2): try: n1 = int(n1) n2 = int(n2) except ValueError: print "Error! Cannot convert values to int!" return n1+n2 Or do something similar. HTH, Wayne -- To be considered stupid and to be told so is more painful than being called gluttonous, mendacious, violent, lascivious, lazy, cowardly: every weakness, every vice, has found its defenders, its rhetoric, its ennoblement and exaltation, but stupidity hasn’t. - Primo Levi
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor