syscmd.py 427 B

1234567891011121314
  1. # Copyright David Abrahams 2004. Use, modification and distribution is
  2. # subject to the Boost Software License, Version 1.0. (See accompanying
  3. # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. import os
  5. import sys
  6. def syscmd(s):
  7. print 'executing: ', repr(s)
  8. sys.stdout.flush()
  9. err = os.system(s)
  10. if err:
  11. raise SystemError, 'command: %s returned %s' % (
  12. repr(s), err)