parameters: (filename_list: Sequence[PathLikeOrStr], batch_content: str = r'@python "%~dp0\%~n0.py" %*')
docstring: :param filename_list: list of file names (full path)
      :param batch_content: contents of the wrapper batch file
      :return: 0 if succeeded, 1 otherwise
      The function create a wrapper batch file for each existing python file for invoking as a script
      It is useful on Windows if the file association of *.py files is not python.exe (but some IDE for instance)
docstring_summary: :param filename_list: list of file names (full path)
      :param batch_content: contents of the wrapper batch file
      :return: 0 if succeeded, 1 otherwise
      The function create a wrapper batch file for each existing python file for invoking as a script
      It is useful on Windows if the file association of *.py files is not python.exe (but some IDE for instance)
docstring_tokens: : param filename_list : list of file names ( full path ) : param batch_content : contents of the wrapper batch file : return : 0 if succeeded 1 otherwise The function create a wrapper batch file for each existing python file for invoking as a script It is useful on Windows if the file association of * . py files is not python . exe ( but some IDE for instance )
function: def batch_creator(filename_list: Sequence[PathLikeOrStr], batch_content: str = r'@python "%~dp0\%~n0.py" %*'):
      """
      :param filename_list: list of file names (full path)
      :param batch_content: contents of the wrapper batch file
      :return: 0 if succeeded, 1 otherwise
      The function create a wrapper batch file for each existing python file for invoking as a script
      It is useful on Windows if the file association of *.py files is not python.exe (but some IDE for instance)
      """
      try:
          for script_name in filename_list:
              py_name = Path(script_name).with_suffix('.py')
              if os.path.exists(py_name):
                  batch_name = py_name.with_suffix('.bat')
                  print(f'Creating: {batch_name}...')
                  with open(batch_name, "w") as file:
                      file.write(batch_content)
          return 0
      except Exception:
          return 1
function_tokens: def batch_creator ( filename_list : Sequence [ PathLikeOrStr ] , batch_content : str = r'@python "%~dp0\%~n0.py" %*' ) : try : for script_name in filename_list : py_name = Path ( script_name ) . with_suffix ( '.py' ) if os . path . exists ( py_name ) : batch_name = py_name . with_suffix ( '.bat' ) print ( f'Creating: {batch_name}...' ) with open ( batch_name , "w" ) as file : file . write ( batch_content ) return 0 except Exception : return 1