ExternalSessionObject

ExternalSessionObject[]

represents an external session started by StartExternalSession for use with ExternalEvaluate.

Details

  • ExternalSessionObject[][prop] returns a property of the external session.
  • The following possible properties can be used:
  • "System"the evaluator system for this session
    "Version"the version of the system
    "Executable"the name of the executable to run to start scripts with
    "ReturnType"type of object to return ("String", "Expression", ...)
    "Prolog"code to run before commands evaluated with this session
    "Epilog"code to run after commands evaluated with this session
    "EvaluationCount"the number of evaluations run with this session
    "SessionTime"the number of seconds elapsed since this session started
  • Available properties can be queried with ExternalSessionObject[]["Properties"].

Examples

open allclose all

Basic Examples  (2)

Start an external session to get an ExternalSessionObject:

Delete the external session with DeleteObject:

Query properties from an ExternalSessionObject:

Delete the session object:

Scope  (2)

Start a session:

List all possible properties:

Make a dataset of all ExternalSessionObject properties:

Delete the session object:

Evaluate code in a session and see the "EvaluationCount" property increase:

Display how long the session has been running with the "SessionTime" property:

Properties & Relations  (1)

Get all external sessions with ExternalSessions:

Delete the session objects:

Introduced in 2017
 (11.2)