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)

你可能感兴趣的:(python,ctypes,user32.dll,LockWorkStation)