MCPcopy Index your code
hub / github.com/Apress/python-for-matlab-development / set

Function set

code/matlab_py/bridge_openpyxl.py:30–61  ·  view source on GitHub ↗

Provide worksheet[cell] = value - and - worksheet[cell].attribute = attribute value capability to MATLAB. The cell's coordinates can be specified with either a location, ie loc = 'B2' or 1-indexed row and column values.

(worksheet,
        loc=None,
        row=None,
        col=None,
        value=None,
        font=None,
        align=None,
        fill=None)

Source from the content-addressed store, hash-verified

28# DEALINGS IN THE SOFTWARE.
29# }}}
30def set(worksheet,
31 loc=None,
32 row=None,
33 col=None,
34 value=None,
35 font=None,
36 align=None,
37 fill=None):
38 """
39 Provide
40 worksheet[cell] = value
41 - and -
42 worksheet[cell].attribute = attribute value
43 capability to MATLAB. The cell's coordinates
44 can be specified with either a location, ie
45 loc = 'B2'
46 or 1-indexed row and column values.
47 """
48 if loc is not None:
49 cell = worksheet[loc]
50 elif row is not None and col is not None:
51 cell = worksheet.cell(row=row, column=col)
52 else:
53 print(f'bridge_openpyxl error: give loc or row and col')
54 if value is not None:
55 cell.value = value
56 if font is not None:
57 cell.font = font
58 if align is not None:
59 cell.alignment = align
60 if fill is not None:
61 cell.fill = fill

Callers 4

connectivityMethod · 0.85
__init__Method · 0.85
connectivityMethod · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected