Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8605971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:58:47+00:00 2026-06-12T02:58:47+00:00

I want to design a python program that handles exceptions in other programs ,

  • 0

I want to design a python program that handles exceptions in other programs , I also want this to access the stack trace in python . I am new t python development but am willing to learn but I do not have a direction on where to proceed . Could somebody please point me to a direction / resources that I could follow and maybe develop these skills , specifically what I should be learning to achieve my goal.

I want to develop this on python 2.7

Thank you for your responses.

EDIT : by handling exceptions , I just want to know what exception occured . Like in Java with try catch blocks where you can print out the stack trace and see if it is an arithmetic / array out of bounds error

Hi I was also thinking of something on this line
something like

  try

 (Execute python program here)  // ie import this program 

 except : 1st exception
 except : 2nd exception
 .
 .
 etc

I know how to read from a file , but an unsure if this is correct for just executing a program written by somebody else?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:58:49+00:00Added an answer on June 12, 2026 at 2:58 am

    Take a look at the traceback module. It formats and prints stack traces. You can use this is a top-level exception handler.

    import sys
    import traceback
    
    try:
        do_something()
    except:
        ex, val, tb = sys.exc_info()
        traceback.print_exception(ex, val, tb)
    

    Python itself essentially does this on any uncaught excepton, then exits.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to design a new category this category will be separated from the
I want to design a webpage login that when click on the login button
I want to design a page in django that has a search bar in
I want to design a c# program which can run program a 3rd exe
I want to design a chat view like BlackBerry messenger (unfortunately new users are
I'm new to python and to django so this question will probably be easy
I am write a raw data to xml file python program, in my design,we
I am new to Python and Django platforms. I am trying to design a
What is the design pattern behind python like interactive shell . I want to
I'm learning CS/Python on MIT's Open Courseware. They want me to design a hangman

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.