I'm in the process of teaching myself python. so please excuse my ignorance. I'm trying to run this statement only if the digital inputstate(True). def insert_to_db(id_sensor, value_sensor): db = MySQLdb.connect("localhost","root","raspberry","sensor_log" ) cu...