Shape
- class Shape(*args, **options)
The shape object is a member of the
shapescollection:>>> import xlwings as xw >>> sheet = xw.books['Book1'].sheets[0] >>> sheet.shapes[0] # or sheet.shapes['ShapeName'] <Shape 'Rectangle 1' in Sheet1>
在 0.9.0 版本发生变更.
- property api: Any
Returns the native object (
pywin32orappscriptobj) of the engine being used.在 0.19.2 版本加入.
- async get_text()
Fetch the shape's text on demand.
Noneif the shape holds no text.Requires xlwings Lite.
- 返回类型:
str | None
- property parent: Sheet
返回形状所属的对象。
在 0.9.0 版本加入.
- scale_height(factor, relative_to_original_size=False, scale='scale_from_top_left')
- 参数:
factor (float) -- For example 1.5 to scale it up to 150%
relative_to_original_size (bool) -- If
False, it scales relative to current height (default). ForTruemust be a picture or OLE object.scale (str) -- One of
scale_from_top_left(default),scale_from_bottom_right,scale_from_middle
在 0.19.2 版本加入.
- scale_width(factor, relative_to_original_size=False, scale='scale_from_top_left')
- 参数:
factor (float) -- For example 1.5 to scale it up to 150%
relative_to_original_size (bool) -- If
False, it scales relative to current width (default). ForTruemust be a picture or OLE object.scale (str) -- One of
scale_from_top_left(default),scale_from_bottom_right,scale_from_middle
在 0.19.2 版本加入.