def print_class(class_name):
 filename = sys.argv[0]
 with open(filename) as f:
  data = f.read()
  regex = (('^(class ' + class_name) + '\\b.*?)^\\S')
  match = re.search(regex, data, flags=(re.MULTILINE | re.DOTALL))
  if match:
   print(match.group(1))

def print_class ( class_name ) : filename = sys . argv [ 0 ] with open ( filename ) as f : data = f . read ( ) regex = ( ( '^(class ' + class_name ) + '\\b.*?)^\\S' ) match = re . search ( regex , data , flags = ( re . MULTILINE | re . DOTALL ) ) if match : print ( match . group ( 1 ) )
read this file and print the section with the class name specified .