interpreter use... help?

Skip Montanaro skip at pobox.com
Mon Aug 6 00:15:42 EDT 2001


    cc> How do I type try and except statements into the interpreter?  I
    cc> know this sounds REALLY REALLY dumb, but I'm having problems.

    cc> Here is what I do:

    try:
              action1()
              except TypeError:

Note that the try: and except ...: clauses have to be at the same
indentation.  That's why you're getting a syntax error.  Also, there has to
be something in the block controlled by the except clause, even if it's just
a pass statement:

    try:
        action1()
    except TypeError:
        pass

-- 
Skip Montanaro (skip at pobox.com)
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list