Apr-24-2020, 01:23 AM
So, I'm mainly a BASH scripter looking to jump into the Python boat.
What's the equivalent to bash -xv when running a python script? Rather than bug people necessarily, I need help on trying to troubleshoot the logic of a python script.
I've already read https://python-forum.io/Thread-Basic-Sim...tracebacks
Scenario:
I'm trying to get the value of channel 7 on a Raspberry Pi to figure out if the value needs to be changed. From my understanding, GPIO.input should output a 1 or a 0. But, when running the script I get nothing. I've even tried usind -d and -vv. But all I get are entries for Importing modules and cleanups.
What's the equivalent to bash -xv when running a python script? Rather than bug people necessarily, I need help on trying to troubleshoot the logic of a python script.
I've already read https://python-forum.io/Thread-Basic-Sim...tracebacks
Scenario:
I'm trying to get the value of channel 7 on a Raspberry Pi to figure out if the value needs to be changed. From my understanding, GPIO.input should output a 1 or a 0. But, when running the script I get nothing. I've even tried usind -d and -vv. But all I get are entries for Importing modules and cleanups.
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setup(7, GPIO.IN) GPIO.setup(7, GPIO.OUT) GPIO.input(7) time.sleep(4) GPIO.cleanup()