[Tutor] Sleep

Tim Golden mail at timgolden.me.uk
Thu Oct 8 09:43:58 CEST 2009


Hristos Giannopoulos wrote:
> Is it possible for a python script to make a windows computer sleep or wake
> from sleep? Preferably in windows?

Nothing built in to the language. You'll need in invoke
the relevant Windows API[1] either via pywin32[2] or ctypes[3]:

[1]
http://msdn.microsoft.com/en-us/library/aa373163%28VS.85%29.aspx
http://msdn.microsoft.com/en-us/library/aa373206%28VS.85%29.aspx
http://msdn.microsoft.com/en-us/library/aa373201%28VS.85%29.aspx


[2] http://sourceforge.net/projects/pywin32/
[3] http://docs.python.org/library/ctypes.html

TJG


More information about the Tutor mailing list