2015-10-26 python> Processing every second> while True: /time.sleep (1)

I would like to graph the temperature and humidity data of DHT11 later.

For the time being, use while and time.sleep () to get it every second.

timer.py


#!/usr/bin/env python
import time

while True:
	print "Hello"
	time.sleep(1)

Implement read processing from DHT11 in the print "Hello" part.

It seems that you can do it with cron, but it is supported by python code.

Recommended Posts

2015-10-26 python> Processing every second> while True: /time.sleep (1)
[Python] Iterative processing (for, while)
python image processing
Python file processing
Python distributed processing Spartan
File processing in Python
Python: Natural language processing
Communication processing by Python
Multithreaded processing in python
First Python image processing
Text processing in Python
Queue processing in Python
Image processing with Python
Python string processing illustration
Various processing of Python