I am running on python 2.7.5. I am converting some bash script to python (learning as I coding) and I'm confused on which is the better solution? I need to copy files to a remote server and then run a script on that remote server using the file. I was using Popen
ssh = subprocess.Popen(["ssh", desthost, "cd {}; {} {}".format(remote_dir, scriptname, filename)]
But it doesn't read my cd. I see that I can use call but I am not clear on if I can get error output from it like I could if I used popen. I keep seeing fabric being mentioned but I didn't know it this could really be done in a one liner. Any advice is appreciated.