[python-win32] Entering commands at Python prompt...

Mark Moales mmoales at fluent.com
Wed Aug 27 16:42:56 EDT 2003


Hi,

I have a simple Python file that creates a process using CreateProcess
and kills it using GenerateConsoleCtrlEvent.  When I run this file, it
works great.  However, when I try to issue these commands at the Python
prompt, I always get:

pywintypes.error: (87, 'GenerateConsoleCtrlEvent', 'The parameter is
incorrect.')

Can someone explain to me why this is happening?  I'm really just
curious.

Thanks,

Mark
-------------- next part --------------
import win32process
import win32con
import win32api

si = win32process.STARTUPINFO()
result = win32process.CreateProcess(
            "C:\\Python23\\python.exe",
            None,
            None,
            None,
            0,
            win32con.CREATE_NEW_CONSOLE | win32con.CREATE_NEW_PROCESS_GROUP,
            None,
            None,
            si)

win32api.GenerateConsoleCtrlEvent(
    win32con.CTRL_BREAK_EVENT,
    result[2])

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mmoales.vcf
Type: text/x-vcard
Size: 270 bytes
Desc: Card for Mark Moales
Url : http://mail.python.org/pipermail/python-win32/attachments/20030827/d4498f30/mmoales.vcf


More information about the Python-win32 mailing list