site_graphlogo
  -   Terms of Use and Privacy
Source Code
cutup   rss
site_graphlogo
  -   Terms of Use and Privacy
Source Code
cutup   rss

Source Code | Triple ReCeiVe

This code will receive transmitted triples. See Triple Pub.

#!/usr/bin/python3
# coding=utf-8
import zstandard as zstd
import base64
import paho.mqtt.client as mqttc
fl=open('dictionary',"rb")
data=fl.read()
dd = zstd.ZstdCompressionDict(data)
dctx = zstd.ZstdDecompressor(dict_data=dd)
def on_message(client, userdata, msg):
   print(dctx.decompress(base64.b64decode(b'KLUv/'+msg.payload)).decode())
client = mqttc.Client()
client.on_message = on_message
client.connect("localhost", 1883, 60)
client.subscribe("allorg/dfd/full")
client.loop_forever()