aboutsummaryrefslogtreecommitdiffstats
path: root/python/examples/publish-example.py
diff options
context:
space:
mode:
authorDevendra2013-12-18 23:23:22 +0530
committerDevendra2013-12-18 23:23:22 +0530
commit786390e9ee0024ab3061a9133700457b07ae0f80 (patch)
tree0aa0acda65ed1c51c68f138c0114055f6769374c /python/examples/publish-example.py
parent1d601e3411af27c1b39e697849a538b692a535e7 (diff)
downloadpubnub-python-786390e9ee0024ab3061a9133700457b07ae0f80.tar.bz2
adding pam client support to python sdk
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)
+