How to fix Segmentation fault (core dumped) in Python | DevErrors