def expand_file_arguments():
 new_args = []
 expanded = False
 for arg in sys.argv:
  if arg.startswith('@'):
   expanded = True
   with open(arg[1:], 'r') as f:
    for line in f.readlines():
     new_args += shlex.split(line)
  else:
   new_args.append(arg)
 if expanded:
  print(('esptool.py %s' % ' '.join(new_args[1:])))
  sys.argv = new_args

def expand_file_arguments ( ) : new_args = [ ] expanded = False for arg in sys . argv : if arg . startswith ( '@' ) : expanded = True with open ( arg [ 1 : ] , 'r' ) as f : for line in f . readlines ( ) : new_args += shlex . split ( line ) else : new_args . append ( arg ) if expanded : print ( ( 'esptool.py %s' % ' ' . join ( new_args [ 1 : ] ) ) ) sys . argv = new_args
any argument starting with "@" gets replaced with all values read from a text file .