# keep-py-file: True
#
# Executes the first arg -- the equivalent of python -c "<code>"
# Used because some executables that will run a script don't support -c
#
# Needs to run on all versions of python
#

import sys

def main(args):
    """ Execute code in args[1] """
    
    if len(args) < 2:
        sys.stderr.write('Argument expected')
        return
    
    code = args[1]
    co = compile(code, '<string>', 'exec')
    exec(co, globals())
    
if __name__ == '__main__':
    main(sys.argv)
