from ctypes import * #定义函数 lock_screen,用于对电脑锁屏 def lock_screen(): user32 = windll.LoadLibrary(‘user32.dll’) user32.LockWorkStation() lock_screen()