parselmouth.praat.run_file

Contents

parselmouth.praat.run_file#

parselmouth.praat.run_file(path: str, *args, **kwargs) object#
parselmouth.praat.run_file(object: parselmouth.Data, path: str, *args, **kwargs) object
parselmouth.praat.run_file(objects: List[parselmouth.Data], path: str, *args, **kwargs) object

Run a Praat script from file.

Given the filename of a Praat script, the script is read and run the same way as a script string passed to parselmouth.praat.run. See run for details on the manner in which the script gets executed.

One thing to note is that relative filenames in the Praat script (including those in potential ‘include’ statements in the script; see Praat: “Scripting 5.8. Including other scripts”) will be resolved relative to the path of the script file, just like in Praat. Also note that Praat accomplishes this by temporarily changing the current working during the execution of the script.

Parameters:
  • object (parselmouth.Data) – A single object to add to the Praat object list, which will be selected when the Praat script is run.

  • objects (List[parselmouth.Data]) – Multiple objects to be added to the Praat object list, which will be selected when the Praat script is run.

  • path (str) – The filename of the Praat script to run.

  • *args – The list of values to be passed as arguments to the Praat script. For more details on the allowed types of these argument, see call.

Keyword Arguments:
  • keep_cwd (bool) – Keep the current working directory (see os.getcwd) when running the script, rather than changing it to the script’s parent directory, as Praat does by default (default value: False). Note that even when set to True, the filenames in the Praat script’s include statements will be resolved relatively to the directory containing the script.

  • **kwargs – See parselmouth.praat.run.

Returns:

See parselmouth.praat.run.

Return type:

object