Site menu

CodeCook.io

  • Languages
    • C
    • C++
    • CSS
    • Git
    • HTML
    • Java
    • JavaScript
    • jQuery
    • PHP
    • Python
    • Ruby
    • Scala
  • error

Python - Exception handling

Catching specific and general exceptions thrown in the execution of a section of code.

0
566
  • Share on Facebook
  • Share on Google+
  • Share on Twitter
try:
    {{try_code}}
except {{specific_error}}:
    {{specific_code}}
except Exception as e:
    {{general_code}}
python

Notes

last update: Oct. 23, 2014

Advertisement

This project is hosted on DigitalOcean, try it and support us

Random task

  • Break out of loop
  • Create and resolve promise
  • Random number
  • Select dom elements by tag
  • Show working tree status
  • Blog
  • About
  • License