diff options
Diffstat (limited to 'py/demo/Ice/callback/Client.py')
-rwxr-xr-x | py/demo/Ice/callback/Client.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/py/demo/Ice/callback/Client.py b/py/demo/Ice/callback/Client.py index 6b8f2a3e403..be583c01edc 100755 --- a/py/demo/Ice/callback/Client.py +++ b/py/demo/Ice/callback/Client.py @@ -14,29 +14,29 @@ Ice.loadSlice('Callback.ice') import Demo def menu(): - print """ + print(""" usage: t: send callback s: shutdown server x: exit ?: help -""" +""") class CallbackReceiverI(Demo.CallbackReceiver): def callback(self, current=None): - print "received callback" + print("received callback") class Client(Ice.Application): def run(self, args): if len(args) > 1: - print self.appName() + ": too many arguments" + print(self.appName() + ": too many arguments") return 1 sender = Demo.CallbackSenderPrx.checkedCast( self.communicator().propertyToProxy('CallbackSender.Proxy'). ice_twoway().ice_timeout(-1).ice_secure(False)) if not sender: - print self.appName() + ": invalid proxy" + print(self.appName() + ": invalid proxy") return 1 adapter = self.communicator().createObjectAdapter("Callback.Client") @@ -51,7 +51,9 @@ class Client(Ice.Application): c = None while c != 'x': try: - c = raw_input("==> ") + sys.stdout.write("==> ") + sys.stdout.flush() + c = sys.stdin.readline().strip() if c == 't': sender.initiateCallback(receiver) elif c == 's': @@ -61,7 +63,7 @@ class Client(Ice.Application): elif c == '?': menu() else: - print "unknown command `" + c + "'" + print("unknown command `" + c + "'") menu() except EOFError: break |