#!/usr/bin/python
import pexpect
import time
command = "sshfs username@server:/path/to/home/folder /mount/point/"
def start_sshfs():
try:
sshfs = pexpect.spawn(command)
sshfs.expect("Password: ")
time.sleep (0.1)
sshfs.sendline ("YourPassword")
time.sleep (10)
sshfs.expect (pexpect.EOF)
except Exception, e:
print str(e)
def main ():
start_sshfs()
if __name__ == '__main__':
main ()