Interpreter.end_of_file

Interpreter.end_of_file()

Raises an EOFError if reading from standard input (simulates Ctrl+D).

As this is a feature not available in pipes but real terminals, it requires PytoRuntime’s patched CPython which uses a global __Py_send_eof flag alongside a SIGHUP signal handler that raises EOFError when reading from readline or when polling standard input witht the select module.