After I begin the polling loop, all messages printed after the first iteration require me to press enter in the terminal for it to be displayed.
#!/usr/bin/python
import socket, select, os, pty, sys
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('', 5007))
s.listen(5)
mypoll = select.poll()
mypoll.register(s.fileno() )
while True:
print "poll time"
subr = mypoll.poll()
for x in subr[0]:
if x == s.fileno():
conn, addr = s.accept()
pid, fd = pty.fork()
if pid != 0:
mypoll.register(fd)
print "done. go back to poll now"
else:
print "forked"
#handles new connection
else:
data = os.read(x,1024)
print data