473,472 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can I make sure my python exit

Hi,

I have a python script:
At the end of the script, I have:

print "Build Done!"

my question is does that mean my python script exits after it prints
"Build done!"

I have a java program which calls this python script. But i run into a
problem in which the python script never returns to the java program
after it performs a system call to execute that python script.

Apr 4 '07 #1
2 1900
On Apr 4, 2:58 pm, "ying...@gmail.com" <ying...@gmail.comwrote:
Hi,

I have a python script:
At the end of the script, I have:

print "Build Done!"

my question is does that mean my python script exits after it prints
"Build done!"

I have a java program which calls this python script. But i run into a
problem in which the python script never returns to the java program
after it performs a system call to execute that python script.

Typically when the last piece of code executes, the program ends. You
could import sys and explicitly exit by calling sys.exit(0).

Mike

Apr 4 '07 #2
Typically when the last piece of code executes, the program ends. You
could import sys and explicitly exit by calling sys.exit(0).
Mike
raise SystemExit
works too.

Bye,
bearophile

Apr 4 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tung Wai Yip | last post by:
I've build the following utility. It works so far but I want to make sure I'm doing the right thing. I am running Python 2.3 on windows 2000. def execute(cmd): """ execute cmd in sub-process,...
6
by: bruce | last post by:
hi... perl has the concept of "die". does python have anything similar. how can a python app be stopped? the docs refer to a sys.stop.. but i can't find anything else... am i missing...
2
by: sunyao | last post by:
Hi Friend, I write a linux shell script to call a python script inside. But I got a wrong exit code from Python exit code. The linux shell script as follows; #!/bin/bash MyPython.py exit $? ...
2
by: Anthon | last post by:
I have a small C program that restarts a python based server application if the exit value of the system("python -m pythonscript arg1 arg2 ...") is greater than 127 (using WEXITSTATUS on the...
0
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 431 open ( +3) / 3425 closed ( +8) / 3856 total (+11) Bugs : 916 open (-23) / 6273 closed (+44) / 7189 total (+21) RFE : 244 open...
2
by: Gigs_ | last post by:
Is there any way to convert ocaml code to python? but not manually thx
3
by: =?UTF-8?Q?Ahmad_=E3=8B=A1_Baitalmal?= | last post by:
Hi, I'm having a hard time getting python-mcrypt extension to build. I installed libmcrypt with --prefix=/usr and I checked that the library exists -rwxr-xr-x 1 root wheel 352K Sep 19...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.