Windowsカウントダウンロックスクリーン-python


#      
import time
from ctypes import *

def closewindows(closetime):
    while closetime>0:
        print(closetime)
        time.sleep(1)
        closetime-=1
    user32 = windll.LoadLibrary('user32.dll')
    user32.LockWorkStation()


if __name__ == "__main__":
    closewindows(3)