From now on, sometimes I would like to publish results of internet searching… that I did NOT find. The results I wanted and I found after just after a long wandering.
When you work with Raspberry Pi, and you are controlling something via output port, say a relay, you can have set a status on it, i.e. you can have put it HIGH, with the usual
import RPi.GPIO as GPIO
Then, some times after, you are willing to know if pin 25 is HIGH o LOW. You have forgot it, or you are not you, but another person willing to know that. Problem: if you set pin 25 as input, you suddenly switch off it. So DO NOT DO this, in the same or another program:
because you will always get a False, at least with default pullups.
Fortunately the answer is simple: just set that pin as output… but read it!
and you will get a True or a False depending on the real status.