in string '-W%s' replace '%s' with o for every o in sys.warnoptions, put the result into a list, append the list to a list containing sys.executable, append sys.argv to the end of the resulting list, substitute the result for args.
args = [ sys . executable ] + [ '-W%s' % o for o in sys . warnoptions ] + sys . argv