Simulate Mouse/Keyboard to stop Screen Saver

Michael J Whitmore michaeljwhitmore at netscape.net
Thu Nov 6 13:33:16 EST 2003


Greetings,

I have a very simple question.  How do you simulate a user input to
turn off a screen saver in Windows (either a mouse movement, mouse
click, or keyboard input)?  I promise I searched the newsgroup before
asking :)
 
I have written the following program that loads all my Webshots files
into the Webshots photo manager, or so I thought.  When you load the
first it starts the screen saver.  All other subsequent ones are not
loaded into the system, unless you sit there and move the mouse.  This
stops the screen saver and when the sleep stops the next one is
started.
 
import os
import re
import time
Directory = "d:/download/webshots/2003-08/"
FileList = os.listdir(Directory)
FileList.sort()
Count = 0
for FileName in FileList:
	CompleteFileName = Directory + FileName
	print "Executing FileName = " +CompleteFileName
	os.startfile(CompleteFileName)
	Count = Count + 1
	time.sleep(5)
print str(Count)+ " files executed"

Since I have approximately 2 photos a day from 1998 on I really don't
want to do this manually.

Thank you




More information about the Python-list mailing list