HHello,
I am using python 2.6 on unix platform. I need to mount window drive from python. For that i done following code. But it does not get mounted.
Code is Here..........
Please let me know where i gone wrong.
It's very urgent.
Thanks in advance.
I am using python 2.6 on unix platform. I need to mount window drive from python. For that i done following code. But it does not get mounted.
Code is Here..........
Code:
import pexpect cmd2="sudo mount -t cifs //<ip address>/FinalWork /mnt/win" child = pexpect.spawn(cmd2) i = child.expect([' password .* ', pexpect.EOF, pexpect.TIMEOUT]) if i == 0: print "******************sending pwd" child.sendline(pwd) #Here pwd is password for sudo print "+++++++++++given password : " + pwd elif i == 1: print "--------------EOF" elif i == 2: print "%%%%%%%%%%%%%%TIMEOUT" print "^^^^^^^^^^^^^^after pwd affair" child.close()
It's very urgent.
Thanks in advance.