[Tutor] Fwd: The results of your email commands
Joel Goldstick
joel.goldstick at gmail.com
Tue Apr 24 12:13:59 CEST 2012
On Tue, Apr 24, 2012 at 4:11 AM, 叶佑群 <ye.youqun at eisoo.com> wrote:
> 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 ?
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
This isn't really a 'learning python' question. But I googled pdedit
and found this:
-a This option is used to add a user into the database. This com-
mand needs a user name specified with the -u switch. When adding
a new user, pdbedit will also ask for the password to be used.
Example: pdbedit -a -u sorce
new password:
retype new password
So it looks like if you use -a you also need -u
--
Joel Goldstick
More information about the Tutor
mailing list