module loghelper.process_script

Short summary

module pyquickhelper.loghelper.process_script

Implements function run_cmd().

source on GitHub

Functions

function

truncated documentation

dictionary_as_class

Every key of dictionary dico becomes a member of a dummy class.

execute_script

Executes a python script in a separate process.

execute_script_get_local_variables

Executes a script and returns the local variables.

Documentation

Implements function run_cmd.

source on GitHub

pyquickhelper.loghelper.process_script.dictionary_as_class(dico)[source]

Every key of dictionary dico becomes a member of a dummy class.

Parameters:

dico – dictionary

Returns:

class

source on GitHub

pyquickhelper.loghelper.process_script.execute_script(code, folder=None, filename='_temp_custom_run_script_.py', check=True)[source]

Executes a python script in a separate process.

Parameters:
  • code – python script

  • folder – write the script in a folder then runs it, it None, the function uses a Pool to execute the script

  • filename – name of the scrit to write

  • check – checks that the output is not empty

Returns:

dictionary with local variables

source on GitHub

pyquickhelper.loghelper.process_script.execute_script_get_local_variables(script, folder=None, filename='_temp_custom_run_script_.py', check=True)[source]

Executes a script and returns the local variables.

Parameters:
  • script – filename or code

  • folder – write the script in a folder then runs it, it None, the function uses a Pool to execute the script

  • filename – name of the scrit to write

  • check – checks that the output is not empty

Returns:

dictionary

source on GitHub