0

I’ve written a Python script that should print some output or at least show an error if something fails. However, when I run it, it just exits immediately without showing anything.
There’s no traceback or visible error message.

I’ve already tried running it from the terminal and adding print statements, but it still closes instantly.
What are the possible reasons for a Python program to exit silently like this?

New contributor
Akash D is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
4
  • 1
    You have not provided your code. Also why are using both the python 3.x and python 2.7 tag. Commented Nov 18 at 10:27
  • 1
    Very few contributors to this platform are psychic. If you need help you'll need to show the code that's troubling you Commented Nov 18 at 10:44
  • A common beginner's mistake is defining a function that contains the code to be run, but then forgetting to actually call the function. That said, I agree with the previous comments: without showing your code, it is not possible to give you advice other than by guessing. Commented Nov 18 at 11:35
  • ”What are the possible reasons for a Python program to exit silently like this?” - One very common reason is a mistake in the code and/or debugging. You imply that you have made no mistakes, but we can’t know that for certain. Commented Nov 18 at 12:22

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.