the first "large" (~500 loc) program i wrote was a cli chat that worked did this. one program send messages by writing to a NFS file, and the other showed the chat (by continuously reading the file).
I spend ages trying to make it one window, by having python's input() not block, but never could.