aboutsummaryrefslogtreecommitdiffstats
path: root/python/examples/publish-example.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/examples/publish-example.py')
-rwxr-xr-xpython/examples/publish-example.py31
1 files changed, 29 insertions, 2 deletions
diff --git a/python/examples/publish-example.py b/python/examples/publish-example.py
index c97034b..c292e5e 100755
--- a/python/examples/publish-example.py
+++ b/python/examples/publish-example.py
@@ -1,14 +1,41 @@
+
+import sys
+sys.path.append('../')
from Pubnub import Pubnub
## Initiate Class
-pubnub = Pubnub( publish_key='demo', subscribe_key='demo', ssl_on=False )
+pubnub = Pubnub( publish_key='demo', subscribe_key='demo', cipher_key='enigma', ssl_on=False )
## Publish Example
info = pubnub.publish({
- 'channel' : 'hello_world',
+ 'channel' : 'abcd',
'message' : {
'some_text' : 'Hello my World'
}
})
print(info)
+info = pubnub.publish({
+ 'channel' : 'abcd',
+ 'message' : ['some_text','Hello my World']
+})
+print(info)
+
+info = pubnub.publish({
+ 'channel' : 'abcd',
+ 'message' : "hi ,this is a string"
+})
+print(info)
+
+info = pubnub.publish({
+ 'channel' : 'abcd',
+ 'message' : 1
+})
+print(info)
+
+info = pubnub.publish({
+ 'channel' : 'abcd',
+ 'message' : 2.1
+})
+print(info)
+