Try on python3



  • import sys
    
    def throws():
        raise RuntimeError('this is the error message')
    
    def main():
        try:
            throws()
            return 0
        except Exception, err:
            sys.stderr.write('ERROR: %s\n' % str(err))
            return 1
    

    Makes a mistake of sitaxis python3.

    In fact, any use of trying makes a mistake.
    Two questions why and what to do



  • except Exception as err:
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2