Instead of having a `\` in there, you can do this:

```python
    db = psycopg2.connect("host='%s' user='%s' password='%s' "
                          "connect_timeout='%s' dbname=postgres"
```