is win api available in native python

Matt Gerrans mgerrans at mindspring.com
Mon Mar 24 01:16:09 EST 2003


Win32 extensions are what you'd want for this kind of thing.   Maybe you can
explain why you don't want to use them?

Anyway, if it is only these two api functions you want to call, then it is
also quite easy to make a little stand-alone tool with C/C++ that you can
call with Python.  In fact for WinXP there is already a utility called
shutdown that you can use; this might also exist on NT and/or Win2k.   In
any case, it might be necessary to write a little util for
InternetAutodialHangup(), as I don't think it is included in the Win32
extensions (I could be wrong -- I'm too lazy to look it up at the moment).
Maybe something similar can be done with WMI, which you can also access with
the win32 extensions.

"Phil" <ycal at grapevine.net> wrote in message news:3e7e5a37_4 at newsfeed...
> I see python has a windows api extension.  But is there something
> available in the native python to close an open dialup connection.  and
> also to exit windows or force shutdown.  I guess I'm looking for the way
> to load and call one of the windows dlls if possible.  I would think I
> need to identify the os so it would only be available to windows users.
>
> the winapi is
> InternetAutodialHangup
> and
> ExitWindowsEx
> -----
>
>
> --
> -
> Phil
>
>






More information about the Python-list mailing list