detect laptop open/close from within Python?

Skip Montanaro skip.montanaro at
Thu Apr 26 13:03:17 EDT 2018

> Thanks, I do have that. Now to figure out when it changes state...
> Unfortunately, the timestamp on the file seems to update continuously,
> not just on state changes. Maybe /proc/acpi/wakeup will be of some
> use.

It appears that I can, at least some of the time. Might need to check
it more frequently than I check for human input, but that will likely
be good enough for my needs.

Thanks again for the pointer.


More information about the Python-list mailing list