Python Subprocess Module | Postgres pg_dump with password

I have a database that I want to back up with my a python code. I tried to base my code from the code in this discussion that uses the subprocess module and pg_dump. My problem now is that I have to …