(Are you Howard the Duck's lesser known cousin?) >>>>> "oscar" == oscartheduck <[EMAIL PROTECTED]> writes:
oscar> I have a small script for doing some ssh stuff for me. I could oscar> have written it as shell script, but wanted to improve my python oscar> skills some. oscar> RIght now, I'm not catching a syntax error as I'd like to. Well, you should probably never catch SyntaxError (unless you use exec or eval, both of which you should also probably never use), however... What you're describing is not a Python syntax error. In addition, if you're expecting to catch problems with the call to input("Please ...") you'll need to have it within the try block. Given that port numbers have to be ints I'd try something like: port = 2024 userport = raw_input("Please enter a port #: ").strip() if userport: try: port = int(userport) except ValueError: pass if port > 65535: blah blah blah ... Note that input("prompt") is equivalent to eval(raw_input("prompt")), so you should probably never use it. (It's going away in Python 3.0 anyway.) Skip -- http://mail.python.org/mailman/listinfo/python-list