import traceback
      
      import traceback
      
      try:
        # your code goes here
      except Exception as e:
        print(e)
        traceback.print_exc()

      Python language logo
      Catch error and then traceback

      exception
      error

      This code prints the traceback object that was raised. From Stackoverflow

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.