Re: how to run shell command like "<

2012-10-07 Thread
于 2012-9-29 19:53, Kushal Kumaran 写道: On Sat, Sep 29, 2012 at 6:18 AM, 叶佑群 wrote: 于 2012-9-28 16:16, Kushal Kumaran 写道: On Fri, Sep 28, 2012 at 1:15 PM, 叶佑群 wrote: Hi, all, I have the shell command like this: sfdisk -uM /dev/sdb<< EOT ,1000,83 ,,83 EOT I have

Re: how to run shell command like "<

2012-09-28 Thread
于 2012-9-28 16:16, Kushal Kumaran 写道: On Fri, Sep 28, 2012 at 1:15 PM, 叶佑群 wrote: Hi, all, I have the shell command like this: sfdisk -uM /dev/sdb<< EOT ,1000,83 ,,83 EOT I have tried subprocess.Popen, pexpect.spawn and os.popen, but none of these works, but when I typ

Re: how to run shell command like "<

2012-09-28 Thread
于 2012-9-28 16:16, Kushal Kumaran 写道: On Fri, Sep 28, 2012 at 1:15 PM, 叶佑群 wrote: Hi, all, I have the shell command like this: sfdisk -uM /dev/sdb<< EOT ,1000,83 ,,83 EOT I have tried subprocess.Popen, pexpect.spawn and os.popen, but none of these works, but when I typ

how to run shell command like "<

2012-09-28 Thread
Hi, all, I have the shell command like this: sfdisk -uM /dev/sdb << EOT ,1000,83 ,,83 EOT I have tried subprocess.Popen, pexpect.spawn and os.popen, but none of these works, but when I type this shell command in shell, it is works fine. I wonder how to emulate this type o

Same code cause the different result.

2012-04-24 Thread
Hi, all I have code as: /pobj = subprocess.Popen (["smbpasswd", user], stdin =subprocess.PIPE) password += "\n" pobj.stdin.write (password) pobj.stdin.write (password)/ the command smbpasswd will change the samba user's password, In shel