how to delete my file if exits in the remote server with paramiko?

2014-12-14 Thread ????????
I want to delete the file names.txt if it exits in /home/names.txt in my remote vps server. import paramiko host = vps ip port = 22 transport = paramiko.Transport((host, port)) password = key username = root transport.connect(username = username, password = password) sftp =

Re: how to delete my file if exits in the remote server with paramiko?

2014-12-14 Thread Skip Montanaro
On Sun, Dec 14, 2014 at 6:49 AM, 水静流深 1248283...@qq.com wrote: Is there more elegant way to do the same work? Unlikely. You have two fairly simple bits of code in your example, one to connect to the remote server, the other to check for the file's existence and remove it. The only extra elegance

Re: how to delete my file if exits in the remote server with paramiko?

2014-12-14 Thread Roy Smith
In article mailman.16944.1418561416.18130.python-l...@python.org, 1248283...@qq.com wrote: I want to delete the file names.txt if it exits in /home/names.txt in my remote vps server. import paramiko host = vps ip port = 22 transport = paramiko.Transport((host, port)) password = key