0

Python newbie here. Sorry if I am a bit unclear. I have a Python script that reads temperature, and I have another script that grabs the temperature value from the first one. If the first script terminates, the second will terminate with it.

How can I keep the second sript from terminating?

Thank you ;)

  • 3
    [Relevant reading](http://stackoverflow.com/questions/2846653/python-multithreading-for-dummies) – wnnmaw Jun 13 '14 at 14:33

1 Answers1

1

This isn't a direct answer to your question, but it's more of a directional consideration that you need to think about.

Since you're talking about temperature monitoring, it's a classic example for a Publish Subscribe model. Recently protocols like MQTT have gained in popularity, and is really helpful for the scenario that you're in.

You should really design your application with scalability in mind and explore before just using threaded python code. There's a cool python example here for MQTT.

ComputerFellow
  • 11,710
  • 12
  • 50
  • 61