Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4430

Python • Re: pylint errors on normal "import RPi.GPIO"

$
0
0
RPi.GPIO is implemented as a c library. Perhaps this is the reason for the lint reports.
Could be. It certainly seems to be a 'pylint' issue or limitation rather than anything else. This is on Buster where the Raspberry Pi provided package is original -

Code:

pi@Pi3B:/tmp/pylint_test $ cat xyzzy.pyimport RPi.GPIO as GPIOprint("GPIO Version = {}".format(GPIO.VERSION))GPIO.setwarnings(False)GPIO.setmode(GPIO.BCM)GPIO.setup(0, GPIO.OUT)GPIO.cleanup()

Code:

pi@Pi3B:/tmp/pylint_test $ python3 xyzzy.pyGPIO Version = 0.7.0pi@Pi3B:/tmp/pylint_test $ 

Code:

pi@Pi3B:/tmp/pylint_test $ pylint3 xyzzy.py************* Module xyzzyxyzzy.py:1:0: C0111: Missing module docstring (missing-docstring)xyzzy.py:4:0: E1101: Module 'RPi.GPIO' has no 'setwarnings' member (no-member)xyzzy.py:5:0: E1101: Module 'RPi.GPIO' has no 'setmode' member (no-member)xyzzy.py:5:13: E1101: Module 'RPi.GPIO' has no 'BCM' member (no-member)xyzzy.py:6:0: E1101: Module 'RPi.GPIO' has no 'setup' member (no-member)xyzzy.py:6:14: E1101: Module 'RPi.GPIO' has no 'OUT' member (no-member)xyzzy.py:7:0: E1101: Module 'RPi.GPIO' has no 'cleanup' member (no-member)----------------------------------------------------------------------Your code has been rated at -41.67/10 (previous run: -41.67/10, +0.00)

Statistics: Posted by hippy — Mon Feb 26, 2024 3:22 pm



Viewing all articles
Browse latest Browse all 4430

Trending Articles