Skip to main content

No project description provided

Project description

bedtime

Python library for doing something when it's almost time for bed (the computer is going to sleep, or turning off).

import time, bedtime

def do_log():
    with open("./test.log", "a") as f:
        f.write("i went to sleep\n")

sleeper = bedtime.Listener(on_sleep=do_log)

while True:
    time.sleep(1)

    # later, after lights out...
    # test.log <
    #   i went to sleep

TODO:

  • Windows
  • MacOS
  • Linux (maybe usually the same as MacOS?)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Bedtime-0.0.3.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

Bedtime-0.0.3-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page