[Tutor] Fwd: The results of your email commands

叶佑群 ye.youqun at eisoo.com
Tue Apr 24 10:11:05 CEST 2012


Hi, all

     I have two block code as:

Block 1:
             #......
             pobj = subprocess.Popen (["passwd", user], 
stdout=subprocess.PIPE, stdin = subprocess.PIPE)
             password = password + "\n"
             pobj.stdin.write (password)
             pobj.stdin.write (password)
             #......
Block 2:
             #......
             pobj = subprocess.Popen (["pdbedit", "-a", user], 
stdout=subprocess.PIPE, stdin =subprocess.PIPE)
             password = password + "\n"
             pobj.stdin.write (password)
             pobj.stdin.write (password)
             #......

         The only difference is command to run, but code of Block 1 runs 
OK, and Block 2 can't write the password to "pdbedit". Is there any 
thing wrong with the code above or if something else cause Block 2 
failed? Any suggestion ?



More information about the Tutor mailing list