Geocrack

class data extraction

Jul 5th, 2022 (edited)
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. class klasse:
  2.     def __init__(self, vorname, name, x, y):
  3.         self.vorname = vorname
  4.         self.name = name
  5.         self.data_x = x
  6.         self.data_y = y
  7.  
  8.  
  9. def main():
  10.     liste = []
  11.     person_1 = klasse('Musterman', 'Max', [42, 23], [1, 2, 3])
  12.     person_2 = klasse('Müller', 'Tom', [32, 54], [3, 2, 1])
  13.  
  14.     liste.append(person_1.__dict__)
  15.     liste.append(person_2.__dict__)
  16.     # liste.append([attr for attr in dir(person_1) if not callable(getattr(person_1, attr)) and not attr.startswith("__")])
  17.     # liste.append([attr for attr in dir(person_2) if not callable(getattr(person_2, attr)) and not attr.startswith("__")])
  18.     print(liste)
  19.    
  20.  
  21. if __name__ == '__main__':
  22.     main()
Advertisement
Add Comment
Please, Sign In to add comment