python实现windows倒计时锁屏功能 # 倒计时锁屏 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