Python script built in bash not coming out

I have a curious problem. I have a bash script that calls a python script inside it. Python script succeeds but never completes completely

The contents of a bash script:

#! /usr/bin/env bash
python python_script.py
echo "bar"

Python script content:

#Much stuff
sys.exit("The python script just ended")

What I expect to see at the end will be as follows:

>The python script just ended
>bar

Instead, I get:

>The python script just ended

If I interrupt the keyboard, bash continues as:

^C>bar

What gives? Obviously the output is correctly called, and there is nothing called a python script between this and the output statement in the bash script.

( " " python script, , . script , - , )

+3
1

sys.exit() , SystemExit. script , sys.exit().

, , daemon, .

, - , script, .

, os._exit(), .

+5

All Articles