run this file (test.py) as:<br><br>def finish():<br> print '\n', "bye", '\n'<br> raw_input('Press Enter to quit: ')<br><br>finish()<br><br>$python -i test.py<br><br>A second approach could be:<br>
<br>def finish():<br> import os, subprocess<br> print '\n', "bye", '\n'<br> raw_input('Press Enter to quit: ')<br> subprocess.call('python')<br><br>finish()<br><br>$python test.py<br>
<br>bye <br><br>Press Enter to quit: <br>Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) <br>[GCC 4.2.1 (Apple Inc. build 5646)] on darwin<br>Type "help", "copyright", "credits" or "license" for more information.<br>
>>> <br><br>A word of caution, am not using IDLE and preferably you should avoid it too.<br><br>~l0nwlf<br><br><br><div class="gmail_quote">On Wed, Mar 24, 2010 at 2:46 AM, bob gailer <span dir="ltr"><<a href="mailto:bgailer@gmail.com">bgailer@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On 3/23/2010 4:47 PM, Wayne Watson wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I use this code to quit a completed program. If no is selected for the yes/no prompt, warning messages appear in the shell window.<br>
</blockquote>
<br></div>
What is the yes/no prompt? Is it in your program or is it a feature of IDLE?<br>
<br>
What are the warning messages?<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I'm executing from IDLE. Is there a way to just return to the >>> prompt there?<br>
<br>
def finish():<br>
print; print "Bye"<br>
print<br>
raw_input('Press Enter to quit')<br>
sys.exit()<br>
<br>
</blockquote>
<br>
<br>
-- <br></div><font color="#888888">
Bob Gailer<br>
919-636-4239<br>
Chapel Hill NC</font><div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
Tutor maillist - <a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
</div></div></blockquote></div><br>