From 80edcffbfe140a6d19c65deca24e1ba1c0f49b99 Mon Sep 17 00:00:00 2001 From: Devendra Date: Mon, 24 Mar 2014 19:17:48 +0530 Subject: support for python3 --- python/examples/here-now-example.py | 4 ++-- python/examples/history-example.py | 1 + python/examples/publish-example.py | 3 +++ python/examples/subscribe-example.py | 5 +++-- 4 files changed, 9 insertions(+), 4 deletions(-) (limited to 'python/examples') diff --git a/python/examples/here-now-example.py b/python/examples/here-now-example.py index d2ca9bd..b9f0b02 100644 --- a/python/examples/here-now-example.py +++ b/python/examples/here-now-example.py @@ -11,7 +11,7 @@ import sys sys.path.append('../') -from twisted.internet import reactor +sys.path.append('./') from Pubnub import Pubnub publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo' @@ -28,7 +28,7 @@ pubnub = Pubnub( publish_key=publish_key, subscribe_key=subscribe_key, crazy = 'hello_world' def print_cb(message): - print message + print(message) pubnub.here_now( { 'channel' : crazy, diff --git a/python/examples/history-example.py b/python/examples/history-example.py index c7c9547..bf78c7d 100755 --- a/python/examples/history-example.py +++ b/python/examples/history-example.py @@ -1,5 +1,6 @@ import sys sys.path.append('../') +sys.path.append('./') from Pubnub import Pubnub ## Initiat Class diff --git a/python/examples/publish-example.py b/python/examples/publish-example.py index c97034b..55f19ea 100755 --- a/python/examples/publish-example.py +++ b/python/examples/publish-example.py @@ -1,3 +1,6 @@ +import sys +sys.path.append('.') +sys.path.append('..') from Pubnub import Pubnub ## Initiate Class diff --git a/python/examples/subscribe-example.py b/python/examples/subscribe-example.py index 14a43d9..a67a08f 100755 --- a/python/examples/subscribe-example.py +++ b/python/examples/subscribe-example.py @@ -1,5 +1,6 @@ import sys -sys.path.append('../') +sys.path.append('..') +sys.path.append('.') import threading import time import random @@ -59,7 +60,7 @@ publish() print("waiting for subscribes and presence") pres_thread.join() -print pubnub.here_now({'channel':channel}) +print(pubnub.here_now({'channel':channel})) sub_thread.join() -- cgit v1.2.3