How to get current selection in calc using python

In LO basic there is the .getSelection() to retrieve the current cell selection. Is there an equivalent in Python, that does not resort to calling the Basic functionality?

Hello,

In Python:

desktop = XSCRIPTCONTEXT.getDesktop()
selection = desktop.CurrentComponent.CurrentController.getSelection()

Thanks, that worked. The intent was to decrease a date in a cell by one as sometimes I enter data a day or two later and wanted to use keystrokes.

@yuquiyu,

As you have been helped, please help others to know the question has been answered by clicking on the :heavy_check_mark: in upper left area of answer which satisfied the question.

try too:

doc = XSCRIPTCONTEXT.getDocument()
selection = doc.CurrentController.Selection