How can I open a lock screen from a python application? I would like the application to do this for me, instead of pressing Ctrl-Alt-L separately.
For Ubuntu:
os.popen('gnome-screensaver-command --lock')
( Source )
For Windows:
import ctypes ctypes.windll.user32.LockWorkStation()
Source: https://habr.com/ru/post/1665437/More articles:Is calling this function ambiguous? - c ++How to create a regular expression for an arbitrary string of digits, which should be the same and can be optionally separated by a space - c #как адресовать ошибку Git "запрашиваемая ветвь вверх по восходящему потоку/мастеру не существует" - gitHow to achieve this complex search using jQuery datatable plugin? - phpMatching by ordered list in java 8 - javaIn Haskell, how can I map a class of a type to an instance of that type? - haskellSwift-Изменить шрифт на HTML-строку, которая имеет свои собственные стили - iosDictionary mapping in IPython recount hashes - pythonAll primitive types implement Copy? - rustAssigning a substring variable in Swift - xcodeAll Articles