There are often times where expect-send is needed on normal files, instead of a process.
The file object passed to an unspawned objects are assumed to be owned by another part of the process. This means that closing these objects does not close the file.
import select, socket
remote = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
spawn_id = ExpectPy.spawnfile(remote)
select.select([spawn_id], , )
spawn_id.expect((ExpectPy.GLOB, "200 *\r\n", 1))