+if args:
+ if not os.path.exists(args[0]):
+ print('File %s not found'%args[0])
+ parser.print_help()
+ sys.exit(1)
+ else:
+ # re-append --help if provided
+ if options.help:
+ args.append('--help')
+ # use args as sys.argv for the next shell, so our own options get removed for the next script
+ sys.argv = args
+ script = sys.argv[0]
+ # Add of script to sys.path
+ path = os.path.dirname(os.path.abspath(script))
+ sys.path.append(path)
+ exec(compile(open(script).read(), script, 'exec'))