iot_python_chapter_09_06.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:Internet-of-Things-with-Python 作者: PacktPublishing 项目源码 文件源码
def on_connect(client, userdata, flags, rc):
    print("Connected to the {0} topic".
          format(topic))
    subscribe_result = client.subscribe(topic)
    publish_result_1 = client.publish(
        topic=topic,
        payload="Listening to messages in the Paho Python Client")
    publish_result_2 = publish_command(
        client,
        topic,
        "print_temperature_fahrenheit",
        "temperature_fahrenheit",
        45)
    publish_result_3 = publish_command(
        client,
        topic,
        "print_information_message",
        "text",
        "Python IoT")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号