LSEG Data Library for Python

session.close

This method closes the session and disconnects your application from the Delivery Platform (formerly Refinitiv data Platform).

Module

lseg.data.session

Syntax

session.close()

Parameters

None.

Returned value

Session state

Usage

The following example demonstrates how to close a session and check the status of the session to ensure that it has been closed successfully.

import lseg.data as ld

DESKTOP_APP_KEY = os.getenv("DESKTOP_APP_KEY")
session = ld.session.desktop.Definition(app_key=DESKTOP_APP_KEY).get_session()
ld.session.set_default(session)
session.open()

# session is opened, so you can close it.
session.close()

# you can check session state
session.open_state  # returns OpenState.Closed

Session state

44 words (0:14 mins)