[Solved] Write to file doesnt work “Indentation error” [duplicate]
If the rest of the code is correct, this should do: def add_sighting(session, spawn_id, pokemon): obj = Sighting( pokemon_id=pokemon[‘id’], spawn_id=spawn_id, expire_timestamp=pokemon[‘disappear_time’], normalized_timestamp=normalize_timestamp(pokemon[‘disappear_time’]), lat=pokemon[‘lat’], lon=pokemon[‘lng’], ) # Check if there isn’t the same entry already existing = session.query(Sighting) \ .filter(Sighting.pokemon_id == obj.pokemon_id) \ .filter(Sighting.spawn_id == obj.spawn_id) \ .filter(Sighting.expire_timestamp > obj.expire_timestamp – 10) \ .filter(Sighting.expire_timestamp < obj.expire_timestamp … Read more