Fix Python linting issues in Python scripts