0
Kodumun içinde Pyt8 python modülünü kullanıyorum. Mağaza Python PEP8 modül çıkışı
import pep8
pep8_checker = pep8.StyleGuide(format='pylint')
pep8_checker.check_files(paths=['./test.py'])
r = pep8_checker.check_files(paths=['./test.py'])
Bu
çıktısı:./test.py:6: [E265] block comment should start with '# '
./test.py:23: [E265] block comment should start with '# '
./test.py:24: [E302] expected 2 blank lines, found 1
./test.py:30: [W293] blank line contains whitespace
./test.py:35: [E501] line too long (116 > 79 characters)
./test.py:41: [E302] expected 2 blank lines, found 1
./test.py:53: [E501] line too long (111 > 79 characters)
./test.py:54: [E501] line too long (129 > 79 characters)
Ancak bu sonuç, terminal ve 'r' atanan son değerine basılır 8 (hataların, yani toplam sayısı) olduğu.
Bu hataları bir değişkende saklamak istiyorum. Bunu nasıl yapabilirim?
DÜZENLEME
: Bunu yapmak için en az iki yolu vardır http://paste.fedoraproject.org/347406/59337502/raw/
Bu downvoters noktaları eğer güzel olurdu en basit bir metin dosyasına
sys.stdout
yöneltmek olan, sonra boş yer dosyayı okumak bu sorunun nesi var? Bir şey mi eksik? –