@Astan<br><br>If you really want to turn your monitor on and off, you should probably try pyserial are pyparrallel(<a href="http://pyserial.sourceforge.net/pyparallel.html" target="_blank">http://pyserial.sourceforge.net/pyparallel.html</a>), along with a solid state relay. That worked for me on linux not sure about windowXP,but it should work.<br>
<br><div class="gmail_quote">On Sat, May 14, 2011 at 1:08 AM, Astan Chee <span dir="ltr"><<a href="mailto:astan.chee@gmail.com">astan.chee@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
I'm trying to turn off my monitor, pause and then turn it on again.<br>
I'm doing this in python 2.6 and windows xp. Here is my script so far<br>
(that doesn't work):<br>
<br>
import time<br>
import win32gui<br>
import win32con<br>
import win32api<br>
<br>
def turnOffMonitor():<br>
SC_MONITORPOWER = 0xF170<br>
win32gui.SendMessage(win32con.HWND_BROADCAST,<br>
win32con.WM_SYSCOMMAND, SC_MONITORPOWER, 2)<br>
<br>
def turnOnMonitor():<br>
SC_MONITORPOWER = 0xF170<br>
win32gui.SendMessage(win32con.HWND_BROADCAST,<br>
win32con.WM_SYSCOMMAND, SC_MONITORPOWER, -1)<br>
<br>
if __name__ == "__main__":<br>
turnOffMonitor()<br>
time.sleep(5)<br>
turnOnMonitor()<br>
<br>
For some reason, the script doesn't turn the monitor back on. What am<br>
I doing wrong here or are there any other alternative?<br>
<font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Regards<br>Leotis Buchanan<br><br><br>