Lock Windows Screen GUI using python

Ian Kelly ian.g.kelly at gmail.com
Tue Jun 3 03:09:38 EDT 2014


On Tue, Jun 3, 2014 at 12:40 AM, Jaydeep Patil <patil.jay2009 at gmail.com> wrote:
> Hi Lan,
>
> Currently I am doing some automation in python excel. It read the data & plots number of graphs. It took more than 20 minutes. So while running my python program if user clicks on excel, error came.
>
> So just i want to lock GUI not workstation.
>
> I hope you understand this.
>
> Let me know if you have any idea about it.

You can set the Application.Interactive property on Excel to block user input:
http://msdn.microsoft.com/en-us/library/office/ff841248(v=office.15).aspx

Example:

excel_app = win32com.client.Dispatch("Excel.Application")
excel_app.Interactive = False
try:
    # Do some automation...
finally:
    excel_app.Interactive = True



More information about the Python-list mailing list