Re: Python or 4NT? With a question or two about popen()

From: Daniel Dittmar (daniel.dittmar_at_sap.corp)
Date: 09/13/04


Date: Mon, 13 Sep 2004 10:37:19 +0200

Robin Siebler wrote:
> I have a bunch of command line tests that I need to automate. I've
> run into too many bugs with the default Win2k command shell, so I need
> to either purchase 4NT or handle the logic and output processing with
> Python. I'm looking for experiences, comments, problems, etc.

I'm using 4NT as my interactive shell and it's fine. But as soon as a
script requires something more complex than an IF, I'm doing it in Python.

> Also, I'm trying to figure out how to use popen(). To say that the
> documentation and expamples available for this is sparse would be the
> understatment of the century! I know that I want to use popen4() but
> what is the difference between os.popen4(), win32pipe.popen4() and
> popen2.popen4()(did I miss any?)?

At least in earlier versions of Python, os.popen* didn't worked when the
script was being called from a service or a GUI program, as such
programs had no 'console' and therefor no stdin and stdout.
win32pipe.popen* fixed that.

Daniel



Relevant Pages

  • Re: perl to python
    ... sed and perl can let you do all that quick command line stuff. ... into a full blown script. ... scripts, call it from the python interpreter, whatever I need. ... If I stick to the traditional unix approach, ...
    (comp.lang.python)
  • Re: newbie question
    ... Python is fun and it's easier to use a real OS to develop the programs, ... Grant it I am a command line junky, ... "The script can be given a executable mode, or permission, using the ... the above seems to me like you are useing windows. ...
    (comp.lang.python)
  • Re: Python executable
    ... Python scripts can be made directly ... >of the script and giving the file an executable mode. ... >$ chmod +x myscript.py ... >but I was given the bash: helloworld.py: command not found error. ...
    (comp.lang.python)
  • Re: Module problem
    ... I am writing some simple script, and when I start my script from command ... Do you have more than one version of Python installed? ...
    (comp.lang.python)
  • Re: Linux application deployment
    ... > The list of command line arguments passed to a Python script. ... > argv has zero length. ...
    (comp.lang.python)