I have a very simple python program that reads one file and overwrites
anouther text file. This workes great from the command line and it has
error checking but just outputs messages and the like to the screen.
The CM team here would like to have the script run each week as part of the
automated rebuilds. The suggestion was to make the execution of the scritp
part of the bigger programs make file. How would I handel errors when the
program is run from a makefile? I hate make so I have not done a lot of
playing with what make can do in this respect but can python get an error
message to make?
In general, you want error messages to go to sys.stderr and you want to return an error code other than zero.
Send messages to stderr:
print >>sys.stderr, message
Return error code
raise SystemExit(1)
At this point, make will respond to errors correctly. You can use make's -k option to ignore them, but the error messages still go the same place as other programs.
HTH,
-Arcege
--
There's so many different worlds,
So many different suns.
And we have just one world,
But we live in different ones.
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor