My app keeps shutting down!

I surround all possible dangerous lines of code with try-except blocks, use an infinite loop, but my application still shuts down without an error message. How to fix it?

Where are you running your code? Is it in a website, from a scheduled task, or from a console? If it's in a console, those aren't designed to run forever -- we sometimes have to restart console servers for system maintenance. With a paid account, you can create what we call an always-on task, which our systems will keep running, restarting it if it stops for any reason -- whether that reason is us needing to do system maintenance, or having a hardware problem, or even if it crashes due to a bug on your side.

I'm quite new to python anywhere. my app gets down about once in 2 days. My app start on web without any problem. Is there any good way to stay the app good? My app is running on web words with

if this case > if it crashes due to a bug on your side, what should I check it?

Take look at the error log and tell us if it's something that you think we should take look at.