publish_single.py 677 字节
Newer Older
R
Roger Light 已提交
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
R
Roger Light 已提交
3 4 5 6 7

# Copyright (c) 2014 Roger Light <roger@atchoo.org>
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Distribution License v1.0
8
# which accompanies this distribution.
R
Roger Light 已提交
9
#
10
# The Eclipse Distribution License is available at
R
Roger Light 已提交
11 12 13 14 15 16 17
#   http://www.eclipse.org/org/documents/edl-v10.php.
#
# Contributors:
#    Roger Light - initial implementation

# This shows an example of using the publish.single helper function.

18 19
import context  # Ensures paho is in PYTHONPATH
import paho.mqtt.publish as publish
R
Roger Light 已提交
20

21
publish.single("paho/test/single", "boo", hostname="test.mosquitto.org")