Re: Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Russell Jackson
I received a reply from the help group that suggested I added a call to flush in there, and that fixed it. The working code looks like this: def setpassword(user): password = "passworD\n" try: cmd = ' passwd {0}'.format(user) pipe = Popen(p4 + cmd, shell=True, stdin=PIPE, st

Re: Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Chris Rebert
On Tue, Sep 15, 2009 at 4:58 PM, Russell Jackson wrote: > I just get an errorlevel from the executable when I read stdout, but I can't > tell what is going on because, of course, I can't tell what Popen is > actually doing. I never see the prompt from the executable that I would > expect to see wh

Re: Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Russell Jackson
I just get an errorlevel from the executable when I read stdout, but I can't tell what is going on because, of course, I can't tell what Popen is actually doing. I never see the prompt from the executable that I would expect to see when I read stdout. I originally had the function like this: def s

Re: Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Rhodri James
On Wed, 16 Sep 2009 00:01:17 +0100, Russell Jackson wrote: Hi, I have the following code that works fine in Python 2.x, but I can't seem to get it to work in Python 3 with Popen. Can you please tell me how to get the same functionality out of Python 3? The gist of what I doing is in the