EOF is a special out-of-band signal which means the end of input. It's not a character (though in the old DOS days, 0x1B acted like EOF), but rather a signal from the OS that the input has ended.
On Windows, you can "input" an EOF by pressing Ctrl+Z
at the command prompt. This signals the terminal to close the input stream, which presents an EOF to the running program. Note that on other OSes or terminal emulators, EOF is usually signalled using Ctrl+D
.
As for your issue with Sublime Text 2, it seems that stdin
is not connected to the terminal when running a program within Sublime, and so consequently programs start off connected to an empty file (probably nul
or /dev/null
). See also Python 3.1 and Sublime Text 2 error.