Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2022
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1.  
  2. class CodeAnalyzer:
  3.  
  4.     def __init__(self):
  5.         self.file_path = ''
  6.         self.file = ''
  7.         self.line = 0
  8.  
  9.     def reader(self):
  10.         self.file = open(self.file_path, 'r')
  11.         for line in self.file:
  12.             self.line += 1
  13.             if len(line) > 79:
  14.                 print(f'Line {self.line}: S001 Too long')
  15.  
  16.             else:
  17.                 continue
  18.  
  19.     def main(self):
  20.         self.file_path = input()
  21.         self.reader()
  22.  
  23.  
  24. if __name__ == '__main__':
  25.  
  26.     code = CodeAnalyzer()
  27.     code.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement