interactive_shell - Base Interactive Remote Shell

Interactive shell with manual stop/start functionality.

Provides a class that doesn’t require being started/stopped using a context manager and can instead be started and stopped manually, or have the stopping process be handled at the time of garbage collection.

class InteractiveShell

Bases: SingleActiveInteractiveShell

Adds manual start and stop functionality to interactive shells.

Like its super-class, this class should not be instantiated directly and should instead be extended. This class also provides an option for automated cleanup of the application using a weakref and a finalize class. This finalize class allows for cleanup of the class at the time of garbage collection and also ensures that cleanup only happens once. This way if a user initiates the closing of the shell manually it is not repeated at the time of garbage collection.

start_application() None

Start the application.

After the application has started, use weakref.finalize to manage cleanup.

close() None

Free all resources using weakref.finalize.