No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
4 Posted Topics
Re: I believe this is due to the way Python handles variables. When you append an element, you are effectively appending a reference, in this case a reference to an array. Each time you run the loop, you empty the array. When you write del temp [:] you are telling Python … | |
Re: (More about exceptions here: [url]http://docs.python.org/tut/node10.html[/url]) Does this do what you want: [code=python] def catchException(): try: f[6] except Exception, inst: print inst else: print "No exception raised." [/code] | |
Re: For a given string s, [icode]s.lower()[/icode] will return the same string entirely in lower case. So, rather than [code=python] if sex == "M": [/code] you could use [code=python] if sex.lower() == "m": [/code] | |
I'm currently writing a set of small scripts for a web page. I've retrieved the GET variables using cgi.parse_qs and the query string, but can't figure out how to access the POST variables. I know you can use FieldStorage to access both GET and POST variables, but would like to … |
The End.