使用 python 调用锁屏
Invoking the lock screen using python
如何从 python 应用程序中调出锁定屏幕?我希望应用程序为我执行此操作,而不是单独按 Ctrl-Alt-L。
对于Ubuntu:
os.popen('gnome-screensaver-command --lock')
(Source)
对于Windows:
import ctypes
ctypes.windll.user32.LockWorkStation()
(Source)
如何从 python 应用程序中调出锁定屏幕?我希望应用程序为我执行此操作,而不是单独按 Ctrl-Alt-L。
对于Ubuntu:
os.popen('gnome-screensaver-command --lock')
(Source)
对于Windows:
import ctypes
ctypes.windll.user32.LockWorkStation()
(Source)