I am able to give the following command in the command-line
C:\\>cd \"C:\\Program Files\\ExtraPuTTY\\Bin\"
C:\\P
You have to pass the cwd as the cwd parameter of the Popen:
Popen(['putty.exe -ssh'...], shell=True, stdout=f, stderr=f, cwd=cwd)
And you should use Plink, not PuTTY, for automating the remote command execution. The Plink accepts the command on its command-line (PuTTY does not):
Popen(['plink.exe -ssh root@172.20.0.102 ls'], shell=True, stdout=f, stderr=f, cwd=cwd)