Hi, i'm new in Python and i'm trying to write some server which can
confirm connection from client.
Here is a part of code:
from socket import *
s = socket(AF_INET, SOCK_STREAM)
client,addr = s.accept()
print "Or u want to accept connection from this host? [y/n]"
opt = sys.stdin.read(1)
if opt == 'y':
else: s.close() #reject
app = TelGUI()
#some menu operations
op = sys.stdin.read(1)
if op == 'x':
if __name__ == "__main__":
maybe someone have some ideas how to block first stdin in main
function and get stdin from the thread when here is a new connection?