Alan Gauld wrote:
On 15/03/12 22:39, Tamar Osher wrote:

try:
import os
# my program
finally:
input ('\n\t\t\tPress the enter key to continue.')
os.system ('pause')

It's more conventional to put the import at the very top, before the try: line.

True, but in this case, if there is an import error, the message will flash by without being read. Wrapping the *entire* program, imports and all, ensures that the program will pause regardless of what happens.


--
Steven

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to