command.getoutput()

Peter Wu peterwu at hotmail.com
Thu Feb 27 02:36:41 EST 2003


>>>>> "Klaus" == Klaus Alexander Seistrup <spam at magnetic-ink.dk> writes:

    Klaus> Peter Wu wrote:
    >>>>> import commands commands.getoutput('ver')
    >> "'{' is not recognized as an internal or external
    >> command,\noperable program or batch file."
    >> 
    >> What's the problem here? Thanks.

    Klaus> The problem is probably that you're running Windows.

Yes, I'm evalulating Python under Windows now.

    Klaus> From commands.py (see "help(commands)"):

    Klaus> 	pipe = os.popen('{' + cmd + '; } 2>&1', 'r')

    Klaus> Does this make sense under Windows?

I'm new to Python. Can you pls show me the code to execute a Win32 command
in Python? Thanks.

-- 
Peter Wu
Powered by Microsoft Windows XP [Version 5.1.2600]

This posting is provided "AS IS" with no warranties, and confers no rights.





More information about the Python-list mailing list