Which Python function should I use, to log off current user. I found an example that is locking my pc, like Win+L combination
ctypes.windll.user32.LockWorkStation ()
but I need a similar function, which will log off.
Try os.system("shutdown -l")
.
shutdown -l
is the windows shell command for logoff