How do i execute some code when I have subscribed to a topic with a message payload for mqtt in python?

2019-08-08 Thread Spencer Du via Python-list
Ok so here is some code below. How do I write an if code block to execute some commands when I subscribe to the topic: microscope/light_sheet_microscope/UI and which has a message which is a device type published to it. I want to execute some code to check if the device has a python file in the

Re: How do i execute some code when I have subscribed to a topic with a message payload for mqtt in python?

2019-08-08 Thread Spencer Du via Python-list
On Thursday, 8 August 2019 22:48:11 UTC+2, Spencer Du wrote: > Ok so here is some code below. How do I write an if code block to execute > some commands when I subscribe to the topic: > microscope/light_sheet_microscope/UI and which has a message which is a > device type published to it. I want

How do I decouple these two modules?

2019-08-28 Thread Spencer Du via Python-list
Hi I have code for a GUI and MQTT. How do I make both of these modules decoupled because currently they rely on each other to some extent. GUI.py import logging from datetime import timedelta import time from thespian.actors import * from transitions import Machine import paho.mqtt.client as mq

How to create list for stuff inside mqtt and GUI?.

2019-09-01 Thread Spencer Du via Python-list
Hi I have code for GUI and MQTT. In GUI.py I have "def loadGUI" which loads up a GUI file if the file exists in current directory. I want to add the file name to a list when a file is imported and for each subsequent file that is imported I want the file name to be imported to the same list an