run_cli#
- run_cli(cmd: str | list, timeout: float | None = None, check_return_value: bool = True, in_background: bool = True, cwd='/') -> (<class 'int'>, <class 'str'>)[source]#
Run a command line.
- Parameters:
- Returns:
return value and output log
- Return type:
Example
>>> cmd_hillshade = ["gdaldem", "--config", >>> "NUM_THREADS", "1", >>> "hillshade", strings.to_cmd_string(dem_path), >>> "-compute_edges", >>> "-z", self.nof_threads, >>> "-az", azimuth, >>> "-alt", zenith, >>> "-of", "GTiff", >>> strings.to_cmd_string(hillshade_dem)] >>> # Run command >>> run_cli(cmd_hillshade)