指定されたキーを押す必要があるとすぐに、python の msvcrt.kbhit() でデータを出力する方法について、私は考えが尽きました。私の欲望の出力を出力する前に、 while ループをもう一度ループする必要があるようです。誰か助けてください。これが私のコードです:
def run(self):
global state
print "\nClient connection received!\n"
self.channel.send("Status: Server connection received")
while 1:
ctr = 1
while 1:
self.clientmess = self.channel.recv(Buffer)
if msvcrt.kbhit():
if msvcrt.getch() == 's':
print "stop"
break
#the codes belo is what i will want for self.clientmess will be so its not necessary I think to put