Re: turn monitor off and on

2011-05-20 Thread Leotis buchanan
@Astan If you really want to turn your monitor on and off, you should probably try pyserial are pyparrallel(http://pyserial.sourceforge.net/pyparallel.html), along with a solid state relay. That worked for me on linux not sure about windowXP,but it should work. On Sat, May 14, 2011 at 1:08 AM, As

Re: turn monitor off and on

2011-05-20 Thread Jack Krieger
> def turnOffMonitor(): > SC_MONITORPOWER = 0xF170 > win32gui.SendMessage(win32con.HWND_BROADCAST, > win32con.WM_SYSCOMMAND, SC_MONITORPOWER, 2) This code does not return control to you, so programm still locked. In my opinion it due broadcasting message. But I do not know how to send message

Re: turn monitor off and on

2011-05-19 Thread Astan Chee
On Mon, May 16, 2011 at 7:29 PM, Gabriel Genellina wrote: > > Your script worked fine for me, 2.6 and XP also. Perhaps your monitor > device driver is buggy or does not implement the required functionality. > Mine is from Philips. > > I'm actually using windows 7. Maybe its the difference in OS? A

Re: turn monitor off and on

2011-05-16 Thread Gabriel Genellina
En Sat, 14 May 2011 03:08:44 -0300, Astan Chee escribió: I'm trying to turn off my monitor, pause and then turn it on again. I'm doing this in python 2.6 and windows xp. Here is my script so far (that doesn't work): def turnOnMonitor(): SC_MONITORPOWER = 0xF170 win32gui.SendMessage(win32

Re: turn monitor off and on

2011-05-15 Thread harrismh777
Gregory Ewing wrote: I'm not so sure about that. If the monitor is an LCD and isn't doing anything to reduce its own power usage, then the backlight is still running and using just as much power, whether the screen is black or not. Depends on dpmi. Some monitors turn off the backlight, and som

Re: turn monitor off and on

2011-05-15 Thread Gregory Ewing
Terry Reedy wrote: My monitor then displays 'No signal detected' in a box and puts itself into a low-power state awaiting a signal. Even if the monitor does not do that, a black screen should use less power. I'm not so sure about that. If the monitor is an LCD and isn't doing anything to redu

Re: turn monitor off and on

2011-05-14 Thread harrismh777
Terry Reedy wrote: The computer cannot turn off the monitor. ... this was my point ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: turn monitor off and on

2011-05-14 Thread Terry Reedy
On 5/14/2011 3:20 AM, harrismh777 wrote: harrismh777 wrote: def turnOnMonitor(): SC_MONITORPOWER = 0xF170 win32gui.SendMessage(win32con.HWND_BROADCAST, win32con.WM_SYSCOMMAND, SC_MONITORPOWER, -1) I've never tried turning my monitor on/off without using my finger... The computer cannot tur

Re: turn monitor off and on

2011-05-14 Thread harrismh777
Steven D'Aprano wrote: I've never tried turning my monitor on/off without using my finger... You've never had your PC turn your monitor off after X minutes of inactivity? I know you're being funny, but actually, no-- I don't. That's a back-in-the-day thing... all of my monitors (and I on

Re: turn monitor off and on

2011-05-14 Thread Alexander Kapps
On 14.05.2011 09:29, harrismh777 wrote: harrismh777 wrote: def turnOnMonitor(): SC_MONITORPOWER = 0xF170 win32gui.SendMessage(win32con.HWND_BROADCAST, win32con.WM_SYSCOMMAND, SC_MONITORPOWER, -1) Wonder what the equivalent of this is in Linux... ? Probably xset dpms force {on,off,...} -- h

Re: turn monitor off and on

2011-05-14 Thread Steven D'Aprano
On Sat, 14 May 2011 02:20:55 -0500, harrismh777 wrote: > harrismh777 wrote: >> >> def turnOnMonitor(): >> SC_MONITORPOWER = 0xF170 >> win32gui.SendMessage(win32con.HWND_BROADCAST, >> win32con.WM_SYSCOMMAND, SC_MONITORPOWER, -1) > > > I've never tried turning my monitor on/off without usi

Re: turn monitor off and on

2011-05-14 Thread harrismh777
harrismh777 wrote: def turnOnMonitor(): SC_MONITORPOWER = 0xF170 win32gui.SendMessage(win32con.HWND_BROADCAST, win32con.WM_SYSCOMMAND, SC_MONITORPOWER, -1) Wonder what the equivalent of this is in Linux... ? -- http://mail.python.org/mailman/listinfo/python-list

Re: turn monitor off and on

2011-05-14 Thread harrismh777
harrismh777 wrote: def turnOnMonitor(): SC_MONITORPOWER = 0xF170 win32gui.SendMessage(win32con.HWND_BROADCAST, win32con.WM_SYSCOMMAND, SC_MONITORPOWER, -1) I've never tried turning my monitor on/off without using my finger... gonna have to play with this... wouldn't that be a great

Re: turn monitor off and on

2011-05-14 Thread harrismh777
Astan Chee wrote: import time import win32gui import win32con import win32api def turnOffMonitor(): SC_MONITORPOWER = 0xF170 win32gui.SendMessage(win32con.HWND_BROADCAST, win32con.WM_SYSCOMMAND, SC_MONITORPOWER, 2) def turnOnMonitor(): SC_MONITORPOWER = 0xF170 win32gui.SendMessage(w

turn monitor off and on

2011-05-13 Thread Astan Chee
Hi, I'm trying to turn off my monitor, pause and then turn it on again. I'm doing this in python 2.6 and windows xp. Here is my script so far (that doesn't work): import time import win32gui import win32con import win32api def turnOffMonitor(): SC_MONITORPOWER = 0xF170 win32gui.SendMessage(wi