Pypath

get_py_path()[source]

Return the current python search path as a cell array of strings

USAGE:

current_py_path = get_py_path()

OUTPUT:

current_py_path – Cell array of strings, the current Python search path

py_addpath(directory, MATLAB_too)[source]

Add directory to import search path for the instance of the Python interpreter currently controlled by MATLAB

EXAMPLE USAGE

>> py_addpath(‘C:DocumentsERPResults’)

REQUIRED INPUTS

directory - Directory to add the Python import search path MATLAB_too - If true (or 1), directory will also be added to the

MATLAB path. {default: false}

OPTIONAL OUTPUT
new_py_path - a cell array of the directories on the updated

Python path; to get this output without updating the Python path, use an empty string as the input: py_path = py_addpath(‘’)

VERSION DATE: 3 Novemeber 2017 AUTHOR: Eric Fields

NOTE: This function is provided “as is” and any express or implied warranties are disclaimed.

py_rmpath(directory, MATLAB_too)[source]

Remove directory from the import search path for the instance of the Python interpreter currently controlled by MATLAB

USAGE:

new_py_path = py_rmpath (directory, MATLAB_too)

INPUTS:
  • directory – Directory to remove from the Python import search path

  • MATLAB_too – If true (or 1), directory will also be removed from the MATLAB path (default: false)

OUTPUT:

new_py_path – Cell array of the directories on the updated Python path; to get this output without updating the Python path, use an empty string as the input: new_py_path = py_rmpath(‘’)

Note

This function is provided “as is” and any express or implied warranties are disclaimed. This code is free and open source software made available under the 3-clause BSD license.

check input